alvarocastro/diamondbot

View on GitHub
commands/ping/src/index.js

Summary

Maintainability
A
35 mins
Test Coverage
import { ChatCommand } from '@diamondbot/core';

export default class PingCommand extends ChatCommand {
    constructor (options = {}) {
        super(Object.assign({
            name: 'ping',
            alias: 'pong',
            description: 'Measures the latency of the bot'
        }, options));
    }

    async exec (message) {
        message.reply(`Pong! This message had a latency of ${Date.now() - message.createdTimestamp}ms.`);
    }
}