#Button interaction doesn't work

3 messages · Page 1 of 1 (latest)

fiery orioleBOT
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

languid gyro
#

    const collectorFilter = i => i.user.id === interaction.user.id;
    try {
      const confirmation = await response.awaitMessageComponent({ filter: collectorFilter, time: 60_000 });
    
      if (confirmation.customId === 'potwierdzeniethx') {
        await confirmation.update({ content: `${user} has been banned for reason:`, components: [] });
      } else if (confirmation.customId === 'odrzuceniethx') {
        await confirmation.update({ content: 'Action cancelled', components: [] });
      }
    } catch (e) {
      await response.editReply({ content: 'Confirmation not received within 1 minute, cancelling', components: [] });
    }
  },
};```