Brozy123 commited on
Commit
4a34c7b
·
verified ·
1 Parent(s): 7793fcb

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +6 -1
index.js CHANGED
@@ -582,7 +582,7 @@ client.on('interactionCreate', async (interaction) => {
582
  }
583
  if (interaction.isChatInputCommand()) {
584
  logTransaction(client, interaction.commandName, interaction.user, interaction.guild, interaction.member);
585
-
586
  if (interaction.commandName === 'ping') {
587
  await safeReply(interaction, `Latency: ${client.ws.ping}ms`);
588
  }
@@ -858,6 +858,11 @@ client.on('interactionCreate', async (interaction) => {
858
  }
859
  }
860
 
 
 
 
 
 
861
  if (interaction.isStringSelectMenu()) {
862
  if (interaction.customId === 'settings_select') {
863
  const value = interaction.values[0];
 
582
  }
583
  if (interaction.isChatInputCommand()) {
584
  logTransaction(client, interaction.commandName, interaction.user, interaction.guild, interaction.member);
585
+
586
  if (interaction.commandName === 'ping') {
587
  await safeReply(interaction, `Latency: ${client.ws.ping}ms`);
588
  }
 
858
  }
859
  }
860
 
861
+ // Global Safety: Acknowledge all buttons/menus immediately to prevent "Unknown Interaction"
862
+ if (interaction.isButton() || interaction.isAnySelectMenu()) {
863
+ await interaction.deferUpdate().catch(() => {});
864
+ }
865
+
866
  if (interaction.isStringSelectMenu()) {
867
  if (interaction.customId === 'settings_select') {
868
  const value = interaction.values[0];