mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-11 15:56:27 +02:00
upgrade ping commande and and userinfo and serverinfo commands
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
const { ButtonStyle, ButtonBuilder, ActionRowBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: 'ping',
|
||||
description: 'Command to check the latency of the bot.',
|
||||
async execute(message, args, client) {
|
||||
const ping = new ButtonBuilder()
|
||||
.setCustomId('confirm')
|
||||
.setLabel('🔄')
|
||||
.setStyle(ButtonStyle.Primary);
|
||||
|
||||
const row = new ActionRowBuilder()
|
||||
.addComponents(ping);
|
||||
const sentMessage = await message.reply({
|
||||
content: `La latence est de : ${client.ws.ping}`,
|
||||
components: [row],
|
||||
});
|
||||
|
||||
|
||||
const filter = i => i.customId === 'confirm' && i.user.id === message.author.id;
|
||||
const collector = sentMessage.createMessageComponentCollector({ filter, time: 15000 })
|
||||
collector.on('collect', async (interaction) => {
|
||||
sentMessage.edit({
|
||||
content: `La latence est de : ${client.ws.ping}`,
|
||||
components: [row],
|
||||
});
|
||||
interaction.reply({ content: 'La latence a été rafraichie', ephemeral: true });
|
||||
});
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user