Update Bot (j'ai plus le repo sur GitHub)
Qui c'est la conne qui a delete le repo sur GitHub? C'EST MOIIIII
This commit is contained in:
31
commands/utility/avatar.js
Normal file
31
commands/utility/avatar.js
Normal file
@@ -0,0 +1,31 @@
|
||||
const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
category: 'utility',
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('avatar')
|
||||
.setDescription('Affiche l\'avatar d\'un utilisateur.')
|
||||
.addUserOption(option =>
|
||||
option.setName('user')
|
||||
.setDescription('L\'utilisateur dont tu veux voir l\'avatar')
|
||||
.setRequired(false)),
|
||||
async execute(interaction) {
|
||||
const target = interaction.options.getUser('user') || interaction.user;
|
||||
const { colors, emojis } = require('../../utils/constants');
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setAuthor({
|
||||
name: `${target.displayName}`,
|
||||
iconURL: target.displayAvatarURL({ dynamic: true })
|
||||
})
|
||||
.setTitle(`${emojis.avatar} Avatar`)
|
||||
.setColor(colors.utility)
|
||||
.setImage(target.displayAvatarURL({ dynamic: true, size: 4096 }))
|
||||
.setDescription(`[Télécharger l'avatar](${target.displayAvatarURL({ dynamic: true, size: 4096 })})`)
|
||||
.setFooter({ text: `Demandé par ${interaction.user.displayName} • ${interaction.guild.name}`, iconURL: interaction.user.displayAvatarURL() })
|
||||
.setTimestamp();
|
||||
|
||||
await interaction.reply({ embeds: [embed] });
|
||||
},
|
||||
};
|
||||
|
||||
@@ -4,20 +4,30 @@ module.exports = {
|
||||
category: 'utility',
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('ping')
|
||||
.setDescription('Replies with API latency and ICMP latency!'),
|
||||
.setDescription('Affiche la latence du bot.'),
|
||||
async execute(interaction) {
|
||||
// --- API latency Discord ---
|
||||
const apiLatency = Math.round(interaction.client.ws.ping);
|
||||
await interaction.deferReply();
|
||||
const sent = await interaction.fetchReply();
|
||||
|
||||
// --- Reply final ---
|
||||
const apiLatency = Math.round(interaction.client.ws.ping);
|
||||
const roundTripLatency = sent.createdTimestamp - interaction.createdTimestamp;
|
||||
|
||||
const { colors, emojis } = require('../../utils/constants');
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle('🏓 Ping Status')
|
||||
.setAuthor({
|
||||
name: `${interaction.client.user.username}`,
|
||||
iconURL: interaction.client.user.displayAvatarURL()
|
||||
})
|
||||
.setTitle(`${emojis.ping} Statut de la Latence`)
|
||||
.setColor(colors.utility)
|
||||
.addFields(
|
||||
{ name: '🌐 API Latency', value: `${apiLatency}ms`, inline: true }
|
||||
{ name: '🌐 Latence API', value: `\`${apiLatency}ms\``, inline: true },
|
||||
{ name: '⏱️ Latence Round-Trip', value: `\`${roundTripLatency}ms\``, inline: true }
|
||||
)
|
||||
.setFooter({ text: `${interaction.guild.name} • ${interaction.client.user.username}`, iconURL: interaction.client.user.displayAvatarURL() })
|
||||
.setTimestamp();
|
||||
|
||||
await interaction.reply({ embeds: [embed] });
|
||||
await interaction.editReply({ embeds: [embed] });
|
||||
},
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user