SetDiscordRichPresenceSmallAsset: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Client function}} The function, you can set the small image of the application. The maximum size of Assets is ''1024x1024'', the minimum ''512x512''. ==Syntax== <syntaxhighlight lang="lua"> bool setDiscordRichPresenceSmallAsset(string assetImage, string text) </syntaxhighlight> {{OOP||DiscordRPC:setSmallAsset}} ===Required arguments=== *'''assetImage''': a string indicating the image you uploaded to your application's asset list. *'''text''': a strin...")
 
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Client function}}
{{Client function}}
The function, you can set the small image of the application. The maximum size of Assets is ''1024x1024'', the minimum ''512x512''.
{{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 small image asset of the application. The maximum size of assets is ''1024x1024'', the minimum ''512x512''.
}}


==Syntax==  
==Syntax==  
Line 10: Line 13:


===Required arguments===
===Required arguments===
*'''assetImage''': a string indicating the image you uploaded to your application's asset list.
*'''assetImage''': a string containing the key of the small image asset you uploaded to your application's asset list.
*'''text''': a string displayed if someone hovers over the image in Discord.
*'''text''': a string containing the hover text of the small image asset.


===Returns===
===Returns===
Returns ''true'' if function succeeds, ''false'' if the client has disabled synchronisation.
Returns ''true'' if function succeeds, ''false'' otherwise.


==Example==
==Example==
The example sets the image to my_logo.
The example sets the small image asset to my_logo.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
addCommandHandler("setsmalllogo",
addCommandHandler("setsmalllogo",

Latest revision as of 22:13, 11 October 2023

[[{{{image}}}|link=|]] Important Note: To use this function, you must set up your own application setDiscordApplicationID
ADDED/UPDATED IN VERSION 1.6.0 r22270:

Using this function, you can set the small image asset of the application. The maximum size of assets is 1024x1024, the minimum 512x512.

Syntax

bool setDiscordRichPresenceSmallAsset(string assetImage, string text)

OOP Syntax Help! I don't understand this!

Method: DiscordRPC:setSmallAsset(...)


Required arguments

  • assetImage: a string containing the key of the small image asset you uploaded to your application's asset list.
  • text: a string containing the hover text of the small image asset.

Returns

Returns true if function succeeds, false otherwise.

Example

The example sets the small image asset to my_logo.

addCommandHandler("setsmalllogo",
    function ()
        if isDiscordRichPresenceConnected() then 
            setDiscordRichPresenceSmallAsset("my_small_logo", "This is my small logo!")
        end 
    end
)

See Also

ADDED/UPDATED IN VERSION 1.6.0 r22342: