Discord roles for permissions (im creative, i know)

THIS IS NO LONGER MAINTAINED. IF YOU WANT A MORE RELIABLE SYSTEM, USE MY NEW SOLUTION, Discordroles - a proper attempt this time.

This is a pretty simple resource to use, and it basically allows you to use discord roles as a means of “Authentication” for certain permissions.

In the config.lua, make sure to have a Discords bot token present (MAKE SURE NOT TO PREFIX IT WITH Bot AS IT AUTOMATICALLY DOES THIS FOR YOU), and also the guild id of where you want the roles to be checked. The roles table is formatted like such:
["Role Nickname"] = "Role ID" - You can get role id by doing @RoleName

Examples:

exports.discord_perms:IsRolePresent(user, "rolenickname")

you can also directly pass a role id, as long as you pass it as an int:

exports.discord_perms:IsRolePresent(user, 1233253245123)

Download:

40 Likes
DiscordChatRoles [Release]
DiscordTagIDs --- I know, I know, I only make discord-based scripts
[Release] No Speaky - Mute Players In Voice Chat [1.0]
[Release] DiscordPedPerms
DiscordVehiclesRestrict
[Release] PoliceEMSActivity (Emergency Blips Script)
[Release] EasyAdmin, an advanced & customisable Admin Menu
[Release] BadgerTools [MAJOR REVAMP]
[Release] DiscordWeaponPerms
[Release] Area of Patrol - Set AOP - Ft. Draw Text, Peacetime & More [AOP] [3.4]
[Release] Discord Vehicle Whitelist - Vehicle Whitelist Based on Roles [2.1]
vMenu
[Release] StaffActivity
I need help in my own script!
Using discord permissions with vMenu and InteractionMenu
Fax Core - Ace Based Permission System, Including Blacklisting of Cars, Peds & Guns [Fax-Core] [2.1]
[RELEASE] Badger_Discord_API
DiscordAcePerms [Release]
DiscordChatRoles [Release]
DiscordVehiclesRestrict
[RELEASE] Badger_Tackle & Badger_Doorlock [NO ESX REQUIRED]
[RELEASE] Badger_Tackle & Badger_Doorlock [NO ESX REQUIRED]
[Release] DiscordWeaponPerms
[RELEASE] Badger-911 (A simple, but efficient 911 script)
[Release] PoliceEMSActivity (Emergency Blips Script)
[RELEASE] Badger-911 (A simple, but efficient 911 script)
[Release] BadgerTools [MAJOR REVAMP]
[RELEASE] Badger_Tackle & Badger_Doorlock [NO ESX REQUIRED]
[Release] PoliceEMSActivity (Emergency Blips Script)
[RELEASE] Bad-Scoreboard (Possibly the best Fivem Server Scoreboard) (SCOREBOARD WORKS WITH ONESYNC INFINITY)
DiscordTagIDs --- I know, I know, I only make discord-based scripts
[RELEASE] Bad-DiscordQueue (A discord role-based queue system) {by Badger}
[Release] BadgerTools [MAJOR REVAMP]

CreativeTea

Love the release bby x

1 Like

noice release ty

Now this seems like a good one! Thanks, gonna check it out!

cute release, will probably use for something

1 Like

PARTYSNAIL

1 Like

:o a new release from you lul, been a while, welcome back

suggestion: fetch roles that exist for a user in general (and names from guild configuration?) and add additional principal inheritance so that permission checks can remain generalized

screw people relying on xPlayer.job ==, vRP’s whatever, this export set; everyone should just add more principals for whatever they do :open_mouth:

5 Likes

Beautiful, definitely going add to my server!

1 Like

Hot release TeaBee

Anyway we could use this to show their role in Discord in the chat. Kinda like @JayJayAuto 's rolesFX but Discord with Integration.

Pardon me if anything I ask here is stupid, I’m very new to scripting and I’d probably benefit from being spoken to like I’m a 5 year old.

I have two problems.

  1. I configured the resource correctly with the information, fed back the correct guild info on the server side of things, but I was getting this error while trying to call the export.

So I decided that maybe my version of the FXServer didn’t support exports properly (I have no actual idea, it was just my next logical thought) and this is where problem two comes in…

  1. Now running the server build from 2019-Jan-14 14:15 (unsure of what build I was running previously), I get this message upon starting the server which related back to discord_perms.
    In short it now completely doesn’t work, and I have made no changes to the original code.

I can probably fix the second issue by reverting back to the server version that it worked with but I have no clue on where to begin on the first one. Any ideas?

This may seem like a dumb question but does this requires jayjay’s resource?

No. Why would it? I was just wondering if this could be used kinda like his script but with the Discord Integration.

Where can I find GuildID ?

the intelligent tea

Somehow the get request for you isn’t returning any data, at the bottom, I can’t test currently but through all of my testing it has worked fine for me

Right click on your discord server and click copy id. Make sure you have developed mode in settings, appearance

I found it anyway , setup all corectly but getting this