feat: mise à jour du code

This commit is contained in:
UltraLionFr
2025-08-26 01:21:58 +02:00
parent 944845cd11
commit d3d3642ec3
29 changed files with 487 additions and 320 deletions
+28 -10
View File
@@ -1,5 +1,5 @@
module.exports = {
name: "interactionCreate",
name: 'interactionCreate',
once: false,
async execute(interaction, client) {
try {
@@ -12,10 +12,16 @@ module.exports = {
// Buttons
if (interaction.isButton()) {
for (const button of client.buttons.values()) {
if (typeof button.id === "string" && button.id === interaction.customId) {
if (
typeof button.id === 'string' &&
button.id === interaction.customId
) {
return button.execute(interaction, client);
}
if (button.id instanceof RegExp && button.id.test(interaction.customId)) {
if (
button.id instanceof RegExp &&
button.id.test(interaction.customId)
) {
return button.execute(interaction, client);
}
}
@@ -24,10 +30,16 @@ module.exports = {
// Modals
if (interaction.isModalSubmit()) {
for (const modal of client.modals.values()) {
if (typeof modal.id === "string" && modal.id === interaction.customId) {
if (
typeof modal.id === 'string' &&
modal.id === interaction.customId
) {
return modal.execute(interaction, client);
}
if (modal.id instanceof RegExp && modal.id.test(interaction.customId)) {
if (
modal.id instanceof RegExp &&
modal.id.test(interaction.customId)
) {
return modal.execute(interaction, client);
}
}
@@ -41,7 +53,7 @@ module.exports = {
interaction.isChannelSelectMenu()
) {
for (const menu of client.menus.values()) {
if (typeof menu.id === "string" && menu.id === interaction.customId) {
if (typeof menu.id === 'string' && menu.id === interaction.customId) {
return menu.execute(interaction, client);
}
if (menu.id instanceof RegExp && menu.id.test(interaction.customId)) {
@@ -52,10 +64,16 @@ module.exports = {
} catch (error) {
console.error(error);
if (interaction.replied || interaction.deferred) {
await interaction.followUp({ content: "❌ Une erreur est survenue.", flags: 64 });
await interaction.followUp({
content: '❌ Une erreur est survenue.',
flags: 64,
});
} else {
await interaction.reply({ content: "❌ Une erreur est survenue.", flags: 64 });
await interaction.reply({
content: '❌ Une erreur est survenue.',
flags: 64,
});
}
}
}
};
},
};
+6 -6
View File
@@ -1,10 +1,10 @@
const { getTicketByChannel } = require("../../handlers/database");
const { cancelTicketClosure } = require("../../handlers/alertManager");
const { lang } = require("../../handlers/configLoader");
const { EmbedBuilder } = require("discord.js");
const { getTicketByChannel } = require('../../handlers/database');
const { cancelTicketClosure } = require('../../handlers/alertManager');
const { lang } = require('../../handlers/configLoader');
const { EmbedBuilder } = require('discord.js');
module.exports = {
name: "messageCreate",
name: 'messageCreate',
once: false,
async execute(message) {
if (message.author.bot) return;
@@ -22,5 +22,5 @@ module.exports = {
await message.channel.send({ embeds: [embed] });
}
}
}
},
};