2020-11-08 03:29:13 +00:00
|
|
|
import { CommandInitializer, Command } from '../parser.js';
|
2020-11-07 23:12:27 +00:00
|
|
|
|
|
|
|
const initializer = new CommandInitializer();
|
|
|
|
|
|
|
|
class PingCommand extends Command {
|
2020-11-08 03:29:13 +00:00
|
|
|
name = 'ping';
|
|
|
|
func(msg, args, ctx) {
|
|
|
|
msg.channel.createMessage('p').then((m) => {
|
|
|
|
m.edit(
|
|
|
|
`rtt: ${Math.floor(m.timestamp - msg.timestamp)}, gateway: ${
|
|
|
|
ctx.bot.shards.get(ctx.bot.guildShardMap[ctx.bot.channelGuildMap[msg.channel.id]] || 0).latency
|
|
|
|
}`
|
|
|
|
);
|
|
|
|
});
|
|
|
|
}
|
2020-11-07 23:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
initializer.addCommand(new PingCommand());
|
|
|
|
|
|
|
|
export default initializer;
|