feat: mise à jour du code
This commit is contained in:
@@ -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,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
@@ -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] });
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user