[SOLVED] Give Role on Button Interaction

There we go
26 Replies
d.js toolkit
d.js toolkit2y 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!
#Kat20
#Kat20OP2y ago
Not having any issues with my other events files, that's what I don't understand
Octoboomer
Octoboomer2y ago
Get which role? Ur talking like we can see ur code or know what ur referring to
#Kat20
#Kat20OP2y ago
Giving a role, sorry
Octoboomer
Octoboomer2y ago
Show code And error
#Kat20
#Kat20OP2y ago
Oh, haven't migrate the discussion I had in #djs-help-v14
#Kat20
#Kat20OP2y ago
#Kat20
#Kat20OP2y ago
The interaction just fails, I don't have any errors
Octoboomer
Octoboomer2y ago
Await the reply You’ll prob get an unknown interaction error Or this just sends the button?
#Kat20
#Kat20OP2y ago
It just sends it
#Kat20
#Kat20OP2y ago
Octoboomer
Octoboomer2y ago
Ur not replying Either use reply to send a message or use update to edit the message the button is on
#Kat20
#Kat20OP2y ago
I'm not sure to follow you
Octoboomer
Octoboomer2y ago
Are you sure ur handler sends all interactions?
#Kat20
#Kat20OP2y ago
Yup
Octoboomer
Octoboomer2y ago
Can you log interaction at the beginning of the arrow function?
#Kat20
#Kat20OP2y ago
Before my trycatch block? I think that it was just a folder name issue, however,
TypeError: Cannot read properties of undefined (reading 'isButton')
TypeError: Cannot read properties of undefined (reading 'isButton')
Oh wait, fixed it by myself; Problem solved, I guess Too dumb, forgot to put the roleid in the .env Second thing, I own the guild, so it is normal that it can give me the role
ShompiFlen
ShompiFlen2y ago
not really you should be able to give roles to anyone as long as some conditions are met
d.js docs
d.js docs2y ago
- Bots cannot moderate (kick/ban/nickname/...) a target with a higher or equally high highest role or the guild owner. - Bots cannot modify (edit/add/remove) roles that are higher or equally high compared to the bot's highest role. - The Administrator permission does not skip these checks.
#Kat20
#Kat20OP2y ago
or the guild owner. And I am.
monbrey
monbrey2y ago
But that line is about kick/ban/nickname
#Kat20
#Kat20OP2y ago
Oh, yeah, right I have the highest role Make sense So I just have to reply back when the role is given to not make it fail, right?
Octoboomer
Octoboomer2y ago
Yea
#Kat20
#Kat20OP2y ago
Could theorically reply and delete, isn't?
Octoboomer
Octoboomer2y ago
Yes Not good UX tbh, but it’s a thing Why not just reply + ephemeral?
#Kat20
#Kat20OP2y ago
That's what I did

Did you find this page helpful?