SetDiscordApplicationID: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Client function}} | {{Client function}} | ||
{{Important Note|To reset, please use [[resetDiscordRichPresenceData]]}} | {{Important Note|To reset the application ID, please use [[resetDiscordRichPresenceData]]}} | ||
{{Important Note|In order for the function to work correctly, | {{Important Note|In order for the function to work correctly, the user must have their activity privacy/status enabled in Discord.}} | ||
{{New feature/item|3.0162|1.6.0|22269| | |||
The function can assign your own application to use in Rich Presence. | The function can assign your own application to use in Rich Presence. | ||
You can create | You can create an application '''[https://discord.com/developers/applications here]''' | ||
}} | |||
==Syntax== | ==Syntax== | ||
Line 13: | Line 15: | ||
===Required arguments=== | ===Required arguments=== | ||
*'''applicationKey''': a string | *'''applicationKey''': a string representing your Discord application's key. | ||
===Returns=== | ===Returns=== | ||
Returns ''true'' if function succeeds, ''false'' if the client has disabled | Returns ''true'' if function succeeds, ''false'' if the client has disabled rich presence. | ||
==Example== | ==Example== | ||
This example | This example outputs whether the application was successfully setup and sets a custom asset image. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
local app_key = "YOUR_APPLICATION_KEY" | local app_key = "YOUR_APPLICATION_KEY" | ||
if setDiscordApplicationID(app_key) then | if setDiscordApplicationID(app_key) then | ||
setDiscordRichPresenceAsset("asset_name_from_application") | setDiscordRichPresenceAsset("asset_name_from_application") | ||
outputChatBox("Yay, we using | outputChatBox("Yay, we're now using our own application!") | ||
end | end | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 00:54, 11 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 applicationKey)
OOP Syntax Help! I don't understand this!
- Method: DiscordRPC:setApplication(...)
Required arguments
- applicationKey: a string representing your Discord application's key.
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_key = "YOUR_APPLICATION_KEY" if setDiscordApplicationID(app_key) then setDiscordRichPresenceAsset("asset_name_from_application") outputChatBox("Yay, we're now using our own application!") end