SetDiscordApplicationID: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Client function}} {{Important Note|To reset, please use resetDiscordRichPresenceData}} The function can assign your own application to use in Rich Presence. You can create own '''[https://discord.com/developers/applications here]''' ==Syntax== <syntaxhighlight lang="lua"> bool setDiscordApplicationID(string applicationKey) </syntaxhighlight> {{OOP||DiscordRPC:setApplication}} ===Required arguments=== *'''applicationKey''': a string represent key...")
 
No edit summary
Line 18: Line 18:


==Example==
==Example==
This example prints out if the application was successfully set up.
This example prints out if the application was successfully set up and set custom asset image.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
local app_key = "YOUR_APPLICATION_KEY"
local app_key = "YOUR_APPLICATION_KEY"

Revision as of 19:31, 10 October 2023

[[{{{image}}}|link=|]] Important Note: To reset, please use resetDiscordRichPresenceData

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

Syntax

bool setDiscordApplicationID(string applicationKey)

OOP Syntax Help! I don't understand this!

Method: DiscordRPC:setApplication(...)


Required arguments

  • applicationKey: a string represent key your's Application on Discord.

Returns

Returns true if successful, false if the client has disabled synchronisation.

Example

This example prints out if the application was successfully set up and set custom asset image.

local app_key = "YOUR_APPLICATION_KEY"
if setDiscordApplicationID(app_key) then 
    setDiscordRichPresenceAsset("asset_name_from_application")
    outputChatBox("Yay, we using now 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: