import { CommandInteraction } from 'discord.js';
import { ApplyOptions } from '@sapphire/decorators';
import { Command } from '@sapphire/framework';
import config from '../config.json';
@ApplyOptions<Command.Options>({
name: 'ping',
description: 'Replies with the bot\'s latency!',
})
export class PingCommand extends Command {
public override registerApplicationCommands(registry: Command.Registry) {
registry.registerChatInputCommand((builder) =>
builder //
.setName(this.name)
.setDescription(this.description),
{
guildIds: [config.eden.guildId],
idHints: ['1288626547959267360']
}
);
}
public override async chatInputRun(interaction: CommandInteraction) {
const sentMessage = await interaction.reply('Pinging...');
const latency = sentMessage.createdTimestamp - interaction.createdTimestamp;
await interaction.editReply(`Pong! Latency is ${latency}ms`);
}
}
import { CommandInteraction } from 'discord.js';
import { ApplyOptions } from '@sapphire/decorators';
import { Command } from '@sapphire/framework';
import config from '../config.json';
@ApplyOptions<Command.Options>({
name: 'ping',
description: 'Replies with the bot\'s latency!',
})
export class PingCommand extends Command {
public override registerApplicationCommands(registry: Command.Registry) {
registry.registerChatInputCommand((builder) =>
builder //
.setName(this.name)
.setDescription(this.description),
{
guildIds: [config.eden.guildId],
idHints: ['1288626547959267360']
}
);
}
public override async chatInputRun(interaction: CommandInteraction) {
const sentMessage = await interaction.reply('Pinging...');
const latency = sentMessage.createdTimestamp - interaction.createdTimestamp;
await interaction.editReply(`Pong! Latency is ${latency}ms`);
}
}