led-bot/cmd/reg.js

17 lines
492 B
JavaScript
Raw Normal View History

2020-11-07 23:12:27 +00:00
import {CommandInitializer, Command} from "../parser.js";
const initializer = new CommandInitializer();
class PingCommand extends Command {
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}`);
});
}
}
initializer.addCommand(new PingCommand());
export default initializer;