SetDiscordRichPresenceAsset

From Multi Theft Auto: Wiki
Revision as of 19:43, 10 October 2023 by Znajder (talk | contribs) (Created page with "__NOTOC__ {{Client function}} The function, you can set the main image of the application. The maximum size of Assets is ''1024x1024'', the minimum ''512x512''. ==Syntax== <syntaxhighlight lang="lua"> bool setDiscordRichPresenceAsset(string assetImage, string text) </syntaxhighlight> {{OOP||DiscordRPC:setAsset}} ===Required arguments=== *'''assetImage''': a string indicating the image you uploaded to your application's asset list. *'''text''': a string displayed...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The function, you can set the main image of the application. The maximum size of Assets is 1024x1024, the minimum 512x512.

Syntax

bool setDiscordRichPresenceAsset(string assetImage, string text)

OOP Syntax Help! I don't understand this!

Method: DiscordRPC:setAsset(...)


Required arguments

  • assetImage: a string indicating the image you uploaded to your application's asset list.
  • text: a string displayed if someone hovers over the image in Discord.

Returns

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

Example

The example sets the image to my_logo.

addCommandHandler("setlogo",
    function ()
        if isDiscordRichPresenceConnected() then 
            setDiscordRichPresenceAsset("my_logo", "This is my logo!")
        end 
    end
)

See Also

ADDED/UPDATED IN VERSION 1.6.0 r22342: