Never expiring button blocks another button

Hello 👋 I made a code so my buttons for a command never expire, but it seems to block other buttons from working.
client.on('interactionCreate', async (interaction) => {
if (!interaction.customId === 'tank' || !interaction.customId === 'dps' || !interaction.customId === 'heal' || !interaction.customId === 'absent' || !interaction.customId === 'reset') return;
// more code here
client.on('interactionCreate', async (interaction) => {
if (!interaction.customId === 'tank' || !interaction.customId === 'dps' || !interaction.customId === 'heal' || !interaction.customId === 'absent' || !interaction.customId === 'reset') return;
// more code here
But i made another command and the buttons of the new command seems to go inside the 'interactionCreate' as if that if ( !customId ) return didnt exist. I changed the if, and instead of !interaction.customId === 'id' i did interaction.customId !== 'id'. It now doesnt block the new command anymore, but now blocks the initial 'tank', 'dps', 'heal', 'absent' and 'reset' buttons. Any ideas ?
3 Replies
d.js toolkit
d.js toolkit•5mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
d.js docs
d.js docs•5mo ago
Checking for things to not be equal in JavaScript:
- if (!yourVariable === yourOtherVariable) // !yourVariable is coerced to a boolean value
+ if (yourVariable !== yourOtherVariable) // checks that one is not equal to the other
- if (!yourVariable === yourOtherVariable) // !yourVariable is coerced to a boolean value
+ if (yourVariable !== yourOtherVariable) // checks that one is not equal to the other
- Comparison operators in JavaScript: learn more
'NoXz
'NoXz•5mo ago
yeah and this is why i changed to !== but now the old command doesnt work and the new command works xD and it doesnt show any error just 'this interaction failed' after a bit