diff --git a/src/class/Command.ts b/src/class/Command.ts new file mode 100644 index 0000000..944c3ca --- /dev/null +++ b/src/class/Command.ts @@ -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 + } +} diff --git a/src/commands/ping.ts b/src/commands/ping.ts new file mode 100644 index 0000000..8af2946 --- /dev/null +++ b/src/commands/ping.ts @@ -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\``) + } +} \ No newline at end of file