Command stuff
parent
83edaf8281
commit
1dd2052b0c
|
@ -0,0 +1,21 @@
|
||||||
|
import { Message } from 'eris'
|
||||||
|
import Client from '../Client'
|
||||||
|
|
||||||
|
export default class Command {
|
||||||
|
name: string
|
||||||
|
description?: string
|
||||||
|
usage?: string
|
||||||
|
enabled: boolean
|
||||||
|
aliases?: string[]
|
||||||
|
client: Client
|
||||||
|
permissions?: { roles: string[], users: string[] }
|
||||||
|
public run (message: Message, args: string[]) {}
|
||||||
|
constructor(client: Client) {
|
||||||
|
this.name = 'None'
|
||||||
|
this.description = 'No description given'
|
||||||
|
this.usage = 'No usage given'
|
||||||
|
this.enabled = false
|
||||||
|
this.aliases = []
|
||||||
|
this.client = client
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
import Command from '../class/Command'
|
||||||
|
import Client from '../Client'
|
||||||
|
import { Message } from 'eris'
|
||||||
|
|
||||||
|
export default class Ping extends Command {
|
||||||
|
constructor(client: Client) {
|
||||||
|
super(client)
|
||||||
|
this.name = 'ping'
|
||||||
|
this.description = 'Pings the bot'
|
||||||
|
}
|
||||||
|
|
||||||
|
public async run (message: Message) {
|
||||||
|
const clientStart: number = Date.now()
|
||||||
|
const msg: Message = await message.channel.createMessage('🏓 Pong!')
|
||||||
|
msg.edit(`🏓 Pong!\nClient: \`${Date.now() - clientStart}ms\`\nResponse: \`${msg.createdAt - message.createdAt}ms\``)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue