Question about Button Interactions
Hello - I have a TempVoice System & Button to Manage on the Embed in the Voice. (Voice Lock & Unlock)
After clicking one Button & re-clicking gives me the "Interaction Error" while clicking again.

37 Replies
- 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!could you clarify which 'interaction error' you're referring to?
do you mean "Interaction failed" in your discord client?
or do you mean some interaction related error in the console?
yea interaction failed in the client

first click on lock -> worked & 2. click -> the interaction failed
well that just means your bot didn't respond to the interaction within 3 seconds
if you're not receiving an error in the console and it doesn't successfully unlock the channel, sounds like this code just isn't executing
If you aren't getting any errors, try to place
console.log checkpoints throughout your code to find out where execution stops.
- Once you do, log relevant values and if-conditions
- More sophisticated debugging methods are breakpoints and runtime inspections: learn moreside note: you'll probably want to defer before doing anything that could cause your bot's response to be late (e.g. at least the
updateChannelPermissions call, not sure what validateVoiceChannel does)probably after that then
And thats the
updateChannelPermissions
@duck
When i change this Code:
to this code:
its not workingI'm not sure what this change has to do with what I said
^
I mean its working again with the other code
but when i change this its stop working without errors

thats a weird thing
if you really believe this change to be related to the issue, I would still suggest logging throughout
the point is to see where execution stops in the absence of an error
Okay i will log everything and will execute the system
This is with the working code without changing the hardcoded member role
now i will do with the dynamic guild everyone roleid
after clicking at unlock -> interaction failed and no error
but when i try to click the buttons via my main discord account it logs me this:
[handleVoiceUnlock] Button pressed by .crizzly
[validateVoiceChannel] Checking channel 1372709942846558308
[validateVoiceChannel] User does not own this channel: 777's Channel vs cRiZZly's Channel
[handleVoiceUnlock] Validation failed
and when im on my 2nd acc try to click the buttons its not working and it fails on interaction failed
I don't need to see the logs
I can't tell where execution stops just from looking at these since I don't know where in your code you added these logs
they're for you to see where execution stops
though it also doesn't seem like you added any logs before the code that I mentioned doesn't execute
i smell a browser issue
I'm not really sure what this has to do with browsers
me either but i dont get it why in my discord client is working but in the browser not where im logged in via my 2nd acc testing it

left client right browser
if you'd like to continue investigating these other ideas for what the issue could be, go ahead
but I won't be helping if you're not willing to read what I say
i found the issue
If i lock the channel (disable connect), i dont have the permissions anymore for the chat and if i click on the interaction aka voice unlock cuz i still have the chat open the interaction fails
But how should i make the logic for that? If i cant connect aka when i lock the channel i dont have access on the chat anymore
admittedly I'm curious as to why discord doesn't have a separate error for that or whether your previous code was working at all if it was also denying the same permission
but putting that aside, you could always specifically grant the user that permission
since you'd be updating multiple overwrites at the same time, you'll want to use
<VoiceChannel>.permissionOverwrites.set() instead of ...edit()okay will use

like this right
I mean if you really want to also allow those permissions, sure
but also you missed the important part
you could always specifically grant the user that permission
The thing is, how do I do that, if I block the connection perm, then I no longer have access to the text chat, that's just the problem why the interaction fails
you could always specifically grant the user that permission
ah yea
forgot to read that part
but then its bad for the other people in the vc no? should i make then all user from the vc in?
and if they leave -> remove?
cuz example: me as owner i lock the channel -> still have access to the chat: example sending a yt video in chat but the other cant see the chat
that's entirely up to you
you get to decide how your bot behaves
but what is the best practise? im a nearly beginner and dont know whats the best
but i still wanna make that good
this isn't really a matter of best practice or not
it's the actual behavior, so it's completely up to you to decide
also it's not as if you can't change the code later if you change your mind
yea i see, thank you very much
still wondering why it didnt gave me an error and i needed to activate my braincells to see mhmm i cant access the chat & then i calculated 1+1 😂