SetDiscordApplicationID

From Multi Theft Auto: Wiki
Jump to navigation Jump to search

[[{{{image}}}|link=|]] Important Note: To reset the application ID, please use resetDiscordRichPresenceData
[[{{{image}}}|link=|]] Important Note: In order for the function to work correctly, the user must have their activity privacy/status enabled in Discord.
ADDED/UPDATED IN VERSION 1.6.0 r22270:

The function can assign your own application to use in Rich Presence. You can create an application here

Syntax

bool setDiscordApplicationID(string applicationID)

OOP Syntax Help! I don't understand this!

Method: DiscordRPC:setApplication(...)


Required arguments

  • applicationID: a string representing your Discord application's ID.

Returns

Returns true if function succeeds, false if the client has disabled rich presence.

Example

This example outputs whether the application was successfully setup and sets a custom asset image.

local app_id = "YOUR_APPLICATION_ID"
if setDiscordApplicationID(app_id) then 
    setDiscordRichPresenceAsset("asset_name_from_application")
    outputChatBox("Yay, we're now using our own application!")
end 

See Also

ADDED/UPDATED IN VERSION 1.6.0 r22270:
ADDED/UPDATED IN VERSION 1.6.0 r22276:
ADDED/UPDATED IN VERSION 1.6.0 r22342: