chore: suppression des commentaires inutiles
This commit is contained in:
@@ -39,7 +39,6 @@ module.exports = {
|
|||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
const inactiveTime = `<t:${Math.floor(now / 1000)}:R>`;
|
const inactiveTime = `<t:${Math.floor(now / 1000)}:R>`;
|
||||||
|
|
||||||
// === Boutons ===
|
|
||||||
const closeBtn = new ButtonBuilder()
|
const closeBtn = new ButtonBuilder()
|
||||||
.setCustomId('closeTicket')
|
.setCustomId('closeTicket')
|
||||||
.setLabel(lang.commands.alert.close_now_label || '🔒 Fermer maintenant')
|
.setLabel(lang.commands.alert.close_now_label || '🔒 Fermer maintenant')
|
||||||
@@ -60,7 +59,6 @@ module.exports = {
|
|||||||
const row1 = new ActionRowBuilder().addComponents(closeBtn, cancelBtn);
|
const row1 = new ActionRowBuilder().addComponents(closeBtn, cancelBtn);
|
||||||
const row2 = new ActionRowBuilder().addComponents(linkBtn);
|
const row2 = new ActionRowBuilder().addComponents(linkBtn);
|
||||||
|
|
||||||
// === Embed principal ===
|
|
||||||
const alertEmbed = new EmbedBuilder()
|
const alertEmbed = new EmbedBuilder()
|
||||||
.setColor(0xe67e22)
|
.setColor(0xe67e22)
|
||||||
.setDescription(
|
.setDescription(
|
||||||
@@ -85,7 +83,6 @@ module.exports = {
|
|||||||
)
|
)
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
|
|
||||||
// === Envoi DM si activé ===
|
|
||||||
if (config.TicketAlert?.DMUser && ticket.userId) {
|
if (config.TicketAlert?.DMUser && ticket.userId) {
|
||||||
const ticketCreator = await client.users
|
const ticketCreator = await client.users
|
||||||
.fetch(ticket.userId)
|
.fetch(ticket.userId)
|
||||||
@@ -102,14 +99,12 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// === Envoi dans le ticket (non éphémère) ===
|
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: ticket.userId ? `<@${ticket.userId}>` : null,
|
content: ticket.userId ? `<@${ticket.userId}>` : null,
|
||||||
embeds: [alertEmbed],
|
embeds: [alertEmbed],
|
||||||
components: [row1],
|
components: [row1],
|
||||||
});
|
});
|
||||||
|
|
||||||
// === Planification de la fermeture auto ===
|
|
||||||
scheduleTicketClosure(interaction.channel, alertDuration, async () => {
|
scheduleTicketClosure(interaction.channel, alertDuration, async () => {
|
||||||
closeTicket(interaction.channel.id);
|
closeTicket(interaction.channel.id);
|
||||||
await interaction.channel.delete().catch(() => {});
|
await interaction.channel.delete().catch(() => {});
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ module.exports = {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// === Embed principal ===
|
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setTitle(panelConfig.Embed.Title || '')
|
.setTitle(panelConfig.Embed.Title || '')
|
||||||
.setDescription(panelConfig.Embed.Description || '')
|
.setDescription(panelConfig.Embed.Description || '')
|
||||||
@@ -58,9 +57,7 @@ module.exports = {
|
|||||||
|
|
||||||
let row;
|
let row;
|
||||||
|
|
||||||
// === Gestion des interactions ===
|
|
||||||
if (panelConfig.InteractionType === 'select' && panelConfig.SelectMenu) {
|
if (panelConfig.InteractionType === 'select' && panelConfig.SelectMenu) {
|
||||||
// 📌 Mode Select Menu
|
|
||||||
const menu = new StringSelectMenuBuilder()
|
const menu = new StringSelectMenuBuilder()
|
||||||
.setCustomId('ticket_select')
|
.setCustomId('ticket_select')
|
||||||
.setPlaceholder(
|
.setPlaceholder(
|
||||||
@@ -81,7 +78,6 @@ module.exports = {
|
|||||||
|
|
||||||
row = new ActionRowBuilder().addComponents(menu);
|
row = new ActionRowBuilder().addComponents(menu);
|
||||||
} else {
|
} else {
|
||||||
// 📌 Mode Boutons par défaut
|
|
||||||
row = new ActionRowBuilder();
|
row = new ActionRowBuilder();
|
||||||
if (panelConfig.Buttons && Array.isArray(panelConfig.Buttons)) {
|
if (panelConfig.Buttons && Array.isArray(panelConfig.Buttons)) {
|
||||||
for (const btn of panelConfig.Buttons) {
|
for (const btn of panelConfig.Buttons) {
|
||||||
@@ -95,7 +91,6 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// === Nettoyage & envoi ===
|
|
||||||
await channel.bulkDelete(10).catch(() => {});
|
await channel.bulkDelete(10).catch(() => {});
|
||||||
await channel.send({ embeds: [embed], components: [row] });
|
await channel.send({ embeds: [embed], components: [row] });
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user