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:

46 Likes

CreativeTea

Love the release bby x

2 Likes

noice release ty

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

cute release, will probably use for something

2 Likes

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:

6 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