SetDiscordApplicationID: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 10: | Line 10: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool setDiscordApplicationID(string | bool setDiscordApplicationID(string applicationID) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[DiscordRPC]]:setApplication}} | {{OOP||[[DiscordRPC]]:setApplication}} | ||
===Required arguments=== | ===Required arguments=== | ||
*''' | *'''applicationID''': a string representing your Discord application's ID. | ||
===Returns=== | ===Returns=== | ||
Returns ''true'' if function succeeds, ''false'' if the client has disabled rich presence. | Returns ''true'' if function succeeds, ''false'' if the client has disabled rich presence. | ||
Line 22: | Line 22: | ||
This example outputs whether the application was successfully setup and sets a custom asset image. | This example outputs whether the application was successfully setup and sets a custom asset image. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
local | local app_id = "YOUR_APPLICATION_ID" | ||
if setDiscordApplicationID( | if setDiscordApplicationID(app_id) then | ||
setDiscordRichPresenceAsset("asset_name_from_application") | setDiscordRichPresenceAsset("asset_name_from_application") | ||
outputChatBox("Yay, we're now using our own application!") | outputChatBox("Yay, we're now using our own application!") |
Latest revision as of 18:39, 24 October 2023
Important Note: To reset the application ID, please use resetDiscordRichPresenceData |
Important Note: In order for the function to work correctly, the user must have their activity privacy/status enabled in Discord. |
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