getDiscordRichPresenceUserID | Multi Theft Auto: Wiki Skip to content

getDiscordRichPresenceUserID

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


The function returns the client Discord UserID.

Important

The function will correctly return the UserID if the user has given consent beforehand and is connected to the Rich Presence application.

Syntax

getDiscordRichPresenceUserID ( )

Code Examples

client

This example displays the user's userid in the chat if they have granted permission to share data. Otherwise, they will receive an appropriate message.

addCommandHandler("getmyuserid",
function ()
if isDiscordRichPresenceConnected() then
local id = getDiscordRichPresenceUserID()
if id == "" then
outputChatBox("You didn't allow consent to share Discord data! Grant permission in the settings!")
else
outputChatBox("Your Discord userid: "..id)
end
end
end
)