Haha-Yes/commands/utility/ping.js

22 lines
597 B
JavaScript
Raw Normal View History

2022-09-12 11:21:30 +02:00
import { SlashCommandBuilder, ButtonBuilder, ActionRowBuilder, ButtonStyle } from 'discord.js';
const { uptimePage } = process.env;
2022-06-17 01:25:05 +02:00
export default {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with Pong!'),
category: 'utility',
async execute(interaction) {
2022-09-12 11:21:30 +02:00
const row = new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setLabel('Status page')
.setURL(uptimePage)
.setStyle(ButtonStyle.Link),
);
await interaction.reply({ content: `Pong! \`${Math.round(interaction.client.ws.ping)} ms\``, components: [row] });
},
};