Discord id c#

hi there… i tried using c# to get the player discord id (i trigger a lua event to check if the role is present in my discord channel) the thing is that when i get the identifiers using c# i can see and print steam, license but not discord… it is an empty identifier, i’m using both client and server repos dlls updated to latest build

couldn’t do it using player.Identifiers[“discord”], nor with GetPlayerIdentifiers since going beyond 0,1,2 i get empty line… so i only can see steam, license, ip address

nor with GetPlayerIdentifiers since going beyond 0,1,2

Seems false here, GetPlayerIdentifiers accepts an 32 bit integer. So you can go way beyond 0 to 2.

well… how can i then… i’d like to not have to use a lua wrapper to do it… but if i have to it’s not a problem

i tried going well beyond i just get an empty line going from 3 and beyond… it only gets me steam, license, ip

If you do not get a discord identifier then most likely the player is not using it. You can do a null check and if its not there when a player is connecting to your server then you can drop them from the server to make sure that they are always using discord its similar to the steam method used in essentialmode

i’m testing it on myself… and i have discord opened… in lua is visible and i c# is not…

Give me a moment to test this i will elt you know my results

1 Like

so it seems it is not in c# here is a dump of the identifiers collection

so i’ll have to write a Lua wrapper to check for it :slight_smile: at least i know it :slight_smile: thank you

It should work the same for both but something is not working somewhere as i also used the API.GetPlayerIdentifiers but its not listing the discord one at all not sure why LUA would be different it makes no sense

honestly it’s not working on lua too now… today was working flawlessly… not both lua and c# are not seeing discord… maybe something with the fivem apis

Did you read the disclaimer on the Discord identifier announcement post?

yeah yea i know it was obvious XD but since like 1 hour before it was working on lua i thought it would have worked on c# too i got it after some time retrying with lua that it was not my fault XD

image

It works in C# i guess the timeout limitations are what is happening it is retrieving it though

yup i saw it this morning i was going to write it like in 10 mins XD

I wonder if we could use D1scord API keys ourselves for our own server via a convar so we can bypass the limitations of using Citizen API keys to process the request it should be fairly simple to implement and most server owners could easily sign up for it.

yeah that would be easier and more customizable

That’s not how this works. We’re also not using any ‘API keys’ at all for this.

Well there must be a way to bypass the rate limits or what is happening that breaks it so it can be a permanent identifier