Discordroles - a proper attempt this time

same here for me

Hey, where do i change that? I get this error about 10 times in a row

Hey, i get error 429, what do i need to change, and where? Thanks :smiley:

Do I put the exports [ā€˜discordrolesā€™]:isRolePresent(ā€˜138725221749358592ā€™, {ā€˜749808671558729729ā€™} --[[ can be a table or just a string. ]], function(hasRole, roles)
if (not roles) then print(ā€œuser not in guildā€) end --roles will be null if no user can be found, suggesting they arent in the guild
print('userHasRole: 'ā€¦(hasRole and ā€˜trueā€™ or ā€˜falseā€™))
print('roles: 'ā€¦json.encode(roles))
end) in the server cfg?

ā€œdebugā€: false,
ā€œversionā€: ā€œ1.0.2ā€,
ā€œdiscordDataā€: {
ā€œguildā€: ā€œ432202912001687575ā€,
ā€œ614934114121809971ā€,

how do i line it to add multiple guilds? is that possible?

it could, but you cant set it up like such in the config. See the exampels at the top, there is an optional ā€œguildā€ param you can pass, which allows you to override the guild set in the config.

1 Like

Appreciate the reply. Yes this is exactly what I was looking for. Completely overlooked that. Cheers

1 Like

im trying to run this with FAXES aop script, when i do /aop i get
[discordroles | DEBUG] get /guilds/585470549170323487/members/570000130699165696

with being told i dont have permission, yet everything is set correctly

mine says couldnā€™t find resource discordroles
and i use Zap if that has anything to do with it

can i link jobs with discrod roles ?

What do I add in the config, besides the token and guild?

Im getting the error "No such export isRolePresent in resource discordroles however, the resource is named discordroles exactly. I have this in the config.json

image

I have read all the comments, and Ive seen multiple people with this issue, with the resource named discordroles, then the magically resolve it?

1 Like

Just wondering how you made it work? Im having the same issueā€¦

1 Like

where do i put the exports

I keep getting this
[discordroles | DEBUG] get /guilds/765991042041511968/members/266699766476439552

yo when i try to do it i put the coding in and it says the menus working but i go in it doesnt work

how to make it work?

I made a resource with a server.lua to run this specifically, below is what i input, the print(ā€˜command runningā€™) will print in my console yet it doesnt do anything elseā€¦ what am i doing wrong?

RegisterCommand("vip", function(source,args,raw)
  print('command running')
  exports['discordroles']:isRolePresent('816673439824740373', function(hasRole, roles)
        if (not roles) then print("user not in guild") end --roles will be null if no user can be found, suggesting they arent in the guild
        print('userHasRole: '..(hasRole and 'true' or 'false'))
        print('roles: '..json.encode(roles))
      end)
end, false)

I do have this working with my discordWhitelist, was just hoping to be able to also use this for VIP related stuff

SCRIPT ERROR: citizen:/scripting/lua/scheduler.lua:955: No such export GetDiscordRoles in resource Badger_Discord_API \ anyone know how to fix this