diff --git a/include/discord-rpc.h b/include/discord-rpc.h index a81673e..8c117ac 100644 --- a/include/discord-rpc.h +++ b/include/discord-rpc.h @@ -44,6 +44,7 @@ typedef struct DiscordRichPresence { typedef struct DiscordJoinRequest { const char* userId; const char* username; + const char* discriminator; const char* avatar; } DiscordJoinRequest; diff --git a/src/discord-rpc.cpp b/src/discord-rpc.cpp index b231e88..fc2ad95 100644 --- a/src/discord-rpc.cpp +++ b/src/discord-rpc.cpp @@ -193,6 +193,10 @@ static void Discord_UpdateConnection(void) if (userId && username && joinReq) { StringCopy(joinReq->userId, userId); StringCopy(joinReq->username, username); + auto discriminator = GetStrMember(user, "discriminator"); + if (discriminator) { + StringCopy(joinReq->discriminator, discriminator); + } if (avatar) { StringCopy(joinReq->avatar, avatar); } @@ -380,7 +384,7 @@ extern "C" DISCORD_EXPORT void Discord_RunCallbacks() while (JoinAskQueue.HavePendingSends()) { auto req = JoinAskQueue.GetNextSendMessage(); if (Handlers.joinRequest) { - DiscordJoinRequest djr{req->userId, req->username, req->avatar}; + DiscordJoinRequest djr{req->userId, req->username, req->discriminator, req->avatar}; Handlers.joinRequest(&djr); } JoinAskQueue.CommitSend();