Discord roles for permissions (im creative, i know)

#1

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:

21 Likes
[Release] Discord Whitelist - Whitelist Based on Roles [1.0]
vMenu v3.0.3 - A server-sided menu including (almost) full permissions support
[Release] No Speaky - Mute Players In Voice Chat [1.0]
[Release] Discord Vehicle Whitelist - Vehicle Whitelist Based on Roles [1.0]
#2

CreativeTea

#3

Love the release bby x

#4

noice release ty

#5

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

#6

cute release, will probably use for something

1 Like
#7

PARTYSNAIL

1 Like
#8

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

#9

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
#10

Beautiful, definitely going add to my server!

1 Like
#11

Hot release TeaBee

#12

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

#13

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?

#14

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

#15

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

#16

Where can I find GuildID ?

#17

the intelligent tea

#18

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

#19

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

#20

I found it anyway , setup all corectly but getting this