```ts import type { Message } from 'discord.js'; import { ApplyOptions } from '@sapphire/decorators'

import type { Message } from 'discord.js';
import { ApplyOptions } from '@sapphire/decorators';
import { Command, CommandOptions } from '@sapphire/framework';
import { send } from '@sapphire/plugin-editable-commands';

@ApplyOptions<CommandOptions>({
    name: 'pong',
    description: 'ping pong'
})
export class UserCommand extends Command {
    public async messageRun(message: Message) {
        const msg = await send(message, 'Ping?');

        const content = `Pong! Bot Latency ${Math.round(this.container.client.ws.ping)}ms. API Latency ${
            (msg.editedTimestamp || msg.createdTimestamp) - (message.editedTimestamp || message.createdTimestamp)
        }ms.`;

        return await send(message, content);
    }
}
Was this page helpful?