This commit is contained in:
VALOU3336
2024-02-17 01:08:14 +01:00
4 changed files with 74 additions and 3 deletions
+31
View File
@@ -0,0 +1,31 @@
const { EmbedBuilder, ButtonStyle, ButtonBuilder, ActionRowBuilder } = require("discord.js")
module.exports = {
name: 'addbtnurl',
description: 'Ajoute un bouton url',
emote: '🔗',
utilisation: 'addbtnurl [url] [message ID] [label]',
category: 'utils',
async execute(message, args, client) {
if (!args[0]) return message.reply('Veuillez fournir une url');
if (!args[1]) return message.reply('Veuillez fournir un ID de message');
if (!args[2]) return message.reply('Veuillez fournir un label');
const url = args[0];
const messageId = args[1];
const label = args.slice(2).join(' ');
const button = new ButtonBuilder()
.setLabel(label)
.setURL(url)
.setStyle(ButtonStyle.Link);
const row = new ActionRowBuilder()
.addComponents(button);
const msg = await message.channel.messages.fetch(messageId);
if (!msg) return message.reply('Message introuvable');
if (msg.author.id !== client.user.id) return message.reply('Ce message n\'a pas été envoyé par moi');
msg.edit({ components: [row] });
},
};
+8 -3
View File
@@ -27,7 +27,9 @@ module.exports = {
.addFields(
{ name: 'Utilisation', value: `\`${prefix}${command.utilisation ? `${command.utilisation}` : ''}\``, inline: true },
{ name: 'Catégorie', value: command.category || 'Non spécifiée', inline: true }
);
)
.setTimestamp()
.setFooter({text: `${client.user.tag} © 2024`, iconURL: client.user.displayAvatarURL({dynamic: true})})
return message.reply({ embeds: [embed_command] });
}
@@ -41,7 +43,6 @@ module.exports = {
game: [],
gestion: [],
utils: [],
other: [],
};
for (const command of client.commands.values()) {
if (command.category) {
@@ -63,6 +64,8 @@ module.exports = {
.setTitle('📚 Information')
.setDescription(description)
.setThumbnail(message.guild.iconURL())
.setTimestamp()
.setFooter({text: `${client.user.tag} © 2024`, iconURL: client.user.displayAvatarURL({dynamic: true})})
};
for (const [category, commands] of Object.entries(categories)) {
@@ -76,7 +79,9 @@ module.exports = {
embeds[category] = new EmbedBuilder()
.setColor('#0099ff')
.setTitle(`Catégorie ${category}`)
.setDescription(description);
.setDescription(description)
.setTimestamp()
.setFooter({text: `${client.user.tag} © 2024`, iconURL: client.user.displayAvatarURL({dynamic: true})})
}
const menu = new StringSelectMenuBuilder()
@@ -34,6 +34,10 @@ module.exports = {
const embed = new EmbedBuilder()
.setTitle(`Avatar de ${user.tag}`)
.setImage(avatar)
.setTimestamp()
.setFooter({text: `${client.user.tag} © 2024`, iconURL: client.user.displayAvatarURL({dynamic: true})});
message.reply({
embeds: [embed],
components: [row]
+31
View File
@@ -0,0 +1,31 @@
const { EmbedBuilder, ButtonStyle, ButtonBuilder, ActionRowBuilder } = require("discord.js")
module.exports = {
name: 'servericon',
description: 'Affiche l\'icone du serveur',
emote: '🖼️',
utilisation: 'servericon',
category: 'utils',
async execute(message, args, client) {
let serverIcon = message.guild.iconURL( { dynamic: true, size: 4096 } );
if (!serverIcon) return message.reply("Ce serveur n'a pas d'icone");
const button = new ButtonBuilder()
.setLabel('Icon url')
.setURL(serverIcon)
.setStyle(ButtonStyle.Link);
const row = new ActionRowBuilder()
.addComponents(button);
const embed = new EmbedBuilder()
.setColor("#FFFFFF")
.setTitle(`🖼️ Icon du serveur \`${message.guild.name}\``)
.setImage(serverIcon)
.setTimestamp()
.setFooter({text: `${client.user.tag} © 2024`, iconURL: client.user.displayAvatarURL({dynamic: true})});
message.reply({ embeds: [embed], components: [row]});
},
};