Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Discord - How to give my bot permissions. [Javascript]

I started to experiment with things that required my bot to have certain permissions. I didn't know how to actually assign these permissions through JS. Does anyone have any ideas? (I also heard the permissions would also make a custom role for the bot)

Thanks.

like image 315
Sean Avatar asked Dec 18 '22 23:12

Sean


2 Answers

You cannot assign permissions to a bot in the guild. They must be willingly given to the bot through the invite scopes of the person who invited it.

And yes, the permissions will give the bot a role in the server, so it can define if you can do something to a user with a higher role.

Im assuming you did these if you already have your bot on a server, but ill explain.

You go to the OAuth2 URL Generator, and put your client ID (I hope you already know how to get that.) You then select the bot scope(and any other scopes you would like...), then scroll down to the permissions section, and select the permission your bot needs. The user has the right to remove these permission, and then you can't really do anything, and hope they know the bot cant do the command then without it.

Then copy the link back up in the Appliction Info area, so you can paste it, and get your bot on a server!

That was alot, hope this helps at all.

like image 87
Swoods23 Avatar answered Dec 20 '22 13:12

Swoods23


  1. Go to oauth generate a URL for
    enter image description here

  2. Scroll to the bottom in Bot Permission select permissions needed by the bot, and kaboom its done :D
    enter image description here

  1. Copy the URL add the bot to your server :D
like image 30
The Flash Avatar answered Dec 20 '22 13:12

The Flash