feat: update interaction replies to use flags for improved visibility
This commit is contained in:
@@ -154,47 +154,49 @@ async function handleDemoInteractions(demoMessage: Message, originalMessage: Mes
|
|||||||
filter: (interaction: MessageComponentInteraction) => interaction.user.id === originalMessage.author.id
|
filter: (interaction: MessageComponentInteraction) => interaction.user.id === originalMessage.author.id
|
||||||
});
|
});
|
||||||
|
|
||||||
collector.on("collect", async (interaction: ButtonInteraction) => {
|
collector.on("collect", async (interaction: MessageComponentInteraction) => {
|
||||||
try {
|
try {
|
||||||
switch (interaction.customId) {
|
if (interaction.isButton()) {
|
||||||
case "quick_action":
|
switch (interaction.customId) {
|
||||||
await interaction.reply({
|
case "quick_action":
|
||||||
content: "⚡ **Acción Rápida Ejecutada!**\n\nEste botón estaba como accesorio en una sección.",
|
await interaction.reply({
|
||||||
ephemeral: true
|
content: "⚡ **Acción Rápida Ejecutada!**\n\nEste botón estaba como accesorio en una sección.",
|
||||||
});
|
flags: 64
|
||||||
break;
|
});
|
||||||
|
break;
|
||||||
|
|
||||||
case "show_more_examples":
|
case "show_more_examples":
|
||||||
await handleMoreExamples(interaction, originalMessage);
|
await handleMoreExamples(interaction, originalMessage);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "change_styles":
|
case "change_styles":
|
||||||
await handleStylesDemo(interaction);
|
await handleStylesDemo(interaction);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "back_to_main":
|
case "back_to_main":
|
||||||
const mainPanel = createMainPanel(originalMessage);
|
const mainPanel = createMainPanel(originalMessage);
|
||||||
const actionRow = createActionRow();
|
const actionRow = createActionRow();
|
||||||
await interaction.update({
|
await interaction.update({
|
||||||
components: [mainPanel, actionRow]
|
components: [mainPanel, actionRow]
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "close_demo":
|
case "close_demo":
|
||||||
await handleCloseDemo(interaction);
|
await handleCloseDemo(interaction);
|
||||||
collector.stop();
|
collector.stop();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
await handleStyleButtons(interaction);
|
await handleStyleButtons(interaction);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error handling demo interaction:", error);
|
console.error("Error handling demo interaction:", error);
|
||||||
if (!interaction.replied && !interaction.deferred) {
|
if (!interaction.replied && !interaction.deferred) {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: "❌ Ocurrió un error al procesar la interacción.",
|
content: "❌ Ocurrió un error al procesar la interacción.",
|
||||||
ephemeral: true
|
flags: 64
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -411,7 +413,7 @@ async function handleStyleButtons(interaction: ButtonInteraction): Promise<void>
|
|||||||
if (styleName) {
|
if (styleName) {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: `🎯 **Botón ${styleName} activado!**\n\nEste botón era un accesorio de una sección.`,
|
content: `🎯 **Botón ${styleName} activado!**\n\nEste botón era un accesorio de una sección.`,
|
||||||
ephemeral: true
|
flags: 64
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user