SetDiscordRichPresenceAsset: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Client function}} | {{Client function}} | ||
{{Important Note|To use this function, you must set up own application [[setDiscordApplicationID]]}} | {{Important Note|To use this function, you must set up your own application [[setDiscordApplicationID]]}} | ||
{{New feature/item|3.0161|1.6.0|22270| | |||
Using this function you can set the large image asset of the application. The maximum size of assets is ''1024x1024'', the minimum is ''512x512''. | |||
}} | |||
==Syntax== | ==Syntax== | ||
Line 11: | Line 13: | ||
===Required arguments=== | ===Required arguments=== | ||
*'''assetImage''': a string | *'''assetImage''': a string containing the key of the image you uploaded to your application's asset list. | ||
*'''text''': a string displayed | *'''text''': a string to be displayed when someone hovers over the large image asset in Discord. | ||
===Returns=== | ===Returns=== | ||
Returns ''true'' if function succeeds, ''false'' | Returns ''true'' if function succeeds, ''false'' otherwise. | ||
==Example== | ==Example== | ||
The example sets the image to my_logo. | The example sets the large image asset to my_logo. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
addCommandHandler("setlogo", | addCommandHandler("setlogo", |
Latest revision as of 22:12, 11 October 2023
Important Note: To use this function, you must set up your own application setDiscordApplicationID |
Syntax
bool setDiscordRichPresenceAsset(string assetImage, string text)
OOP Syntax Help! I don't understand this!
- Method: DiscordRPC:setAsset(...)
Required arguments
- assetImage: a string containing the key of the image you uploaded to your application's asset list.
- text: a string to be displayed when someone hovers over the large image asset in Discord.
Returns
Returns true if function succeeds, false otherwise.
Example
The example sets the large image asset to my_logo.
addCommandHandler("setlogo", function () if isDiscordRichPresenceConnected() then setDiscordRichPresenceAsset("my_logo", "This is my logo!") end end )