Make a button executable only by the command executer
Hello, I want to make a button only executable only by the person who ran it.
For example, if person A runs command fuzz only they are allowed to click on button B
I thought this would work it seems to split out
[ERROR] Encountered error while handling an interaction handler run method for interaction-handler "bankButton" at path "C:\Users\Isidr\Documents\GitHub\cobaltia\cobaltia\dist\interaction-handlers\buttons\bankButton.js" TypeError: Cannot read properties of undefined (reading 'id')
Also, update the tags to include 14.14.xSolution:Jump to solution
I would add userId to the button custom id and regex match it. One way it says you can do it in guide iirc
10 Replies
hello? anyone please just added so many people
OH GOD LOL
oops
anyways mentions arent what you wanna use iirc
I couldn't find anything in the server guide
it would be nice to know what to do after a long time of not getting help
Solution
I would add userId to the button custom id and regex match it. One way it says you can do it in guide iirc
also don't you want to just check if message.author.id === interaction.user.id?
author is the bot
i just integrate it into the custom id
yeah I don't know why I didn't think of this