This commit is contained in:
2026-03-15 12:22:42 +01:00
parent cd99275933
commit 311ba5e7f3
558 changed files with 55182 additions and 22981 deletions

View File

@@ -1,45 +1,43 @@
const { SlashCommandBuilder, EmbedBuilder, PermissionFlagsBits } = require('discord.js');
module.exports = {
category: 'info',
data: new SlashCommandBuilder()
.setName('embed')
.setDescription('Créer un embed personnalisé.')
.addStringOption(option =>
option.setName('title')
.setDescription('Titre de l\'embed')
.setRequired(true))
.addStringOption(option =>
option.setName('description')
.setDescription('Description de l\'embed')
.setRequired(true))
.addStringOption(option =>
option.setName('color')
.setDescription('Couleur de l\'embed (hex, ex: #FF0000)')
.setRequired(false))
.setDefaultMemberPermissions(PermissionFlagsBits.ManageMessages),
async execute(interaction) {
const title = interaction.options.getString('title');
const description = interaction.options.getString('description');
const colorInput = interaction.options.getString('color');
category: 'info',
data: new SlashCommandBuilder()
.setName('embed')
.setDescription('Créer un embed personnalisé.')
.addStringOption(option =>
option.setName('title')
.setDescription('Titre de l\'embed')
.setRequired(true))
.addStringOption(option =>
option.setName('description')
.setDescription('Description de l\'embed')
.setRequired(true))
.addStringOption(option =>
option.setName('color')
.setDescription('Couleur de l\'embed (hex, ex: #FF0000)')
.setRequired(false))
.setDefaultMemberPermissions(PermissionFlagsBits.ManageMessages),
async execute(interaction) {
const title = interaction.options.getString('title');
const description = interaction.options.getString('description');
const colorInput = interaction.options.getString('color');
let color = 0x5865F2; // Couleur par défaut (bleu Discord)
if (colorInput) {
// Parser la couleur hex
const hexMatch = colorInput.match(/^#?([0-9A-Fa-f]{6})$/);
if (hexMatch) {
color = parseInt(hexMatch[1], 16);
}
}
let color = 0x5865F2;
if (colorInput) {
const hexMatch = colorInput.match(/^#?([0-9A-Fa-f]{6})$/);
if (hexMatch) {
color = parseInt(hexMatch[1], 16);
}
}
const embed = new EmbedBuilder()
.setTitle(title)
.setDescription(description)
.setColor(color)
.setFooter({ text: `Créé par ${interaction.user.tag}`, iconURL: interaction.user.displayAvatarURL() })
.setTimestamp();
await interaction.reply({ embeds: [embed] });
},
};
const embed = new EmbedBuilder()
.setTitle(title)
.setDescription(description)
.setColor(color)
.setFooter({ text: `Créé par ${interaction.user.tag}`, iconURL: interaction.user.displayAvatarURL() })
.setTimestamp();
await interaction.reply({ embeds: [embed] });
},
};