IsDiscordRichPresenceConnected: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Client function}} The function check the client has synchronisation with Discord Rich Presence enabled. ==Syntax== <syntaxhighlight lang="lua"> bool isDiscordRichPresenceConnected() </syntaxhighlight> {{OOP||DiscordRPC:isConnected}} ===Returns=== Returns ''true'' if the Discord Rich Presence is enabled on the client, ''false'' if the client has disabled synchronisation. ==Example== This example prints out if the client has enabled Discord Rich Prese...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Client function}}
{{Client function}}
The function check the client has synchronisation with Discord Rich Presence enabled.
{{New feature/item|3.0161|1.6.0|22270|
The function checks if the client has Discord Rich Presence enabled.
}}


==Syntax==  
==Syntax==  
Line 10: Line 12:


===Returns===
===Returns===
Returns ''true'' if the Discord Rich Presence is enabled on the client, ''false'' if the client has disabled synchronisation.
Returns ''true'' if Discord Rich Presence is enabled on the client, ''false'' if disabled.


==Example==
==Example==
This example prints out if the client has enabled Discord Rich Presence.
This example outputs whether the client has enabled Discord Rich Presence.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
addCommandHandler("checkdiscord",
addCommandHandler("checkdiscord",

Latest revision as of 22:12, 11 October 2023

ADDED/UPDATED IN VERSION 1.6.0 r22270:

The function checks if the client has Discord Rich Presence enabled.

Syntax

bool isDiscordRichPresenceConnected()

OOP Syntax Help! I don't understand this!

Method: DiscordRPC:isConnected(...)


Returns

Returns true if Discord Rich Presence is enabled on the client, false if disabled.

Example

This example outputs whether the client has enabled Discord Rich Presence.

addCommandHandler("checkdiscord",
    function ()
        if isDiscordRichPresenceConnected() then 
            outputChatBox("You are using Discord Rich Presence, that's cool!")
        end 
    end
)

See Also

ADDED/UPDATED IN VERSION 1.6.0 r22342: