[SOLVED] Give Role on Button Interaction

There we go
26 Replies
d.js toolkit
d.js toolkit16mo 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
#Kat20OP16mo ago
Not having any issues with my other events files, that's what I don't understand
Kinect3000
Kinect300016mo ago
Get which role? Ur talking like we can see ur code or know what ur referring to
#Kat20
#Kat20OP16mo ago
Giving a role, sorry
Kinect3000
Kinect300016mo ago
Show code And error
#Kat20
#Kat20OP16mo ago
Oh, haven't migrate the discussion I had in #djs-help-v14
#Kat20
#Kat20OP16mo ago
#Kat20
#Kat20OP16mo ago
The interaction just fails, I don't have any errors
Kinect3000
Kinect300016mo ago
Await the reply You’ll prob get an unknown interaction error Or this just sends the button?
#Kat20
#Kat20OP16mo ago
It just sends it
#Kat20
#Kat20OP16mo ago
Kinect3000
Kinect300016mo ago
Ur not replying Either use reply to send a message or use update to edit the message the button is on
#Kat20
#Kat20OP16mo ago
I'm not sure to follow you
Kinect3000
Kinect300016mo ago
Are you sure ur handler sends all interactions?
#Kat20
#Kat20OP16mo ago
Yup
Kinect3000
Kinect300016mo ago
Can you log interaction at the beginning of the arrow function?
#Kat20
#Kat20OP16mo 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
ShompiFlen16mo ago
not really you should be able to give roles to anyone as long as some conditions are met
d.js docs
d.js docs16mo 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
#Kat20OP16mo ago
or the guild owner. And I am.
monbrey
monbrey16mo ago
But that line is about kick/ban/nickname
#Kat20
#Kat20OP16mo 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?
Kinect3000
Kinect300016mo ago
Yea
#Kat20
#Kat20OP16mo ago
Could theorically reply and delete, isn't?
Kinect3000
Kinect300016mo ago
Yes Not good UX tbh, but it’s a thing Why not just reply + ephemeral?
#Kat20
#Kat20OP16mo ago
That's what I did
Want results from more Discord servers?
Add your server