alvarocastro/discord-bot

View on GitHub
src/commands/ping.js

Summary

Maintainability
A
0 mins
Test Coverage
import { ChannelChatCommand } from '../chat-command';

export default class PingCommand extends ChannelChatCommand {
    name = 'ping';
    description = 'Measures the latency of the bot';

    run (message) {
        const timeTaken = Date.now() - message.createdTimestamp;
        message.reply(`Pong! This message had a latency of ${timeTaken}ms.`);
    }
}