1
0
Fork 0
cloudservices/src/commands/ping.ts

17 lines
582 B
TypeScript
Raw Normal View History

2019-10-14 18:02:04 -04:00
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\``)
}
}