altv:MP resource that uses OAuth2 discord api to connect players to server depending on the roles
- clone this repo in dir 'discord' otherwise you need to change the code
- In "discord" directory run these command.
npm i
- you need to create a discord app & bot here Discord applications
- go to OAuth2 tab and add a Redirect URI as
http://resources/discord/html/index.html
- copy ClientID and
- got to : discord/server/config.json
- select ************** and past to set your client_id
- copy token from bot tab and
- got to : discord/server/config.json
- past it where key = token
- create 'whitelist' role in your discord server and 'owner' role
- start the resource
- send !set config to the bot
- and !wl to update the list of the whitelisted players (users that have role whitelist)