Im currently making a ticket system, where after choosing the category in a selection menu, the old selection menu is replaced with one for the subcategory. This is the code for the start of my main category event, which reads out which main category was selected. The same thing however also triggers when selecting a subcategory.
client.on('interactionCreate', async interaction => {
console.log(interaction.customId); //remove
if(!interaction.customId === 'staff_selection_menu' || !interaction.isSelectMenu()) return;
console.log(`[${new Date().toLocaleTimeString()}] Staff ticket category received.`);
After adding a console.log to check the customId of the interaction, I get the following
role_selection_menu //the logged customId of the interaction
[17:35:51] Staff ticket category received. //The log that shows the category event was called, shouldnt happen
[17:35:51] Staff ticket subcategory received.//The log that shows the subcategory event was called, should happen
As you can see despite logging that the id was 'role_selection_menu' it passed the if-clause that should return on anything but 'staff_selection_menu'
Im pretty sure this is some idiotic mistake, but I tried everything, and for the life of me, cant find out why this is happening.