Discord roles for permissions (im creative, i know)

You sure the token and guild I’d is Correct? There’s no other way you should get that error

Ok so It’s more than possible I am a retard but, can the role nickname have a [space] in it since it is in quotation “”? Also would I be able to hook this into a “chat role” system in-game?

Also how do the “permission thingies” work? Could I have it to replace ACE permissions?

I might make a system for it to work with aces, but right now you can simple have an if statement, and yes, your role nickname can be whatever you wish and yes for chat system, might make an example for that

1 Like

So would this code work, im very new to scripting

Config = {
	DiscordToken = "NTMxOTI2NTI3MTM1NDQ-----------------------------",
	GuildId = "470245542996475906",

	-- Format: ["Role Nickname"] = "Role ID" You can get role id by doing \@RoleName
	Roles = {
		["Founder"] = "♔ Offical Founder of LADPS ♔ " -- This would be checked by doing exports.discord_perms:IsRolePresent(user, "TestRole")
		["Owner"] = "Server Owner"
	}
}

In Role you have to add role id, not role name.
Use @rolename, send and then right click and copy id.
@sadboilogan Yeaim sure GUILD and token are correct.

Just edited your code to remove the token, you probably want to regenerate that token, as it could be used to take over your Didcotd bot

I saw, why I changed it quick

Also make sure you use role id, and not role name

was just changing it

Thats odd, I’m currently not at home so I can’t check your setup, however I will be able to shortly

Even when i use link manually:
https://discordapp.com/api/guilds/505387880365948931/members/447733315286466560
Its returning 401. Im sure bot token is correct because im using it with my node.js bot.

Try give the bot admin perms if it hasn’t already unsure oh what the required permissions are

So this is a bit of @JayJayAuto 's chat roles.

AddEventHandler('chatMessage', function(Source, Name, Msg)
    args = stringsplit(Msg, " ")
    CancelEvent()
    if string.find(args[1], "/") then
        local cmd = args[1]
        table.remove(args, 1)
    else     
        local player = GetPlayerIdentifiers(Source)[1]
        if has_value(o, player) then
            TriggerClientEvent('chatMessage', -1, "^7[^8Owner^7]  " .. Name, { 0, 0, 0 }, Msg)    
	elseif has_value(co, player) then
            TriggerClientEvent('chatMessage', -1, "^7[^5Co-Owner^7] " .. Name, { 0, 159, 255 }, Msg)

What would I put instead of if has_value(o, player)?

Actually bot have ALL permissions, including admin.

Odd, as mine is working fine currently with the example i posted earlier too.

check this example:

this should be all you need to figure it out.

Yep thanks. Ill see what I can do

https://images.illusivetea.me/52b2l4.png

its working fine here, also same on the resource. Are you sure you didnt prefix your DiscordToken in config.lua with Bot ? I probably should mention that it will automatically do that for you.

Okay everyone. I know what was wrong. By just writing @rolename and rightclick>copy id you are copying MESSAGE ID.
To get role id you have to write @rolename. With backslash.
Thanks for help and awesome release @sadboilogan

p.s: I have no idea why that was returning 401 :smiley:

I’m back with more dumb questions, sorry!

Is “missing identifier” related to the script not picking up a player’s Discord id or would it be something on my side, like client/player id’s?

Myself and my mods don’t have this issue but a few cops do, it seems pretty randomized from what I’ve noticed but I’m just trying to figure out if it’s because I’m not delivering the player/client id correctly or if it’s something with Discord. Thanks!