Discord::update: Difference between revisions

From RAGE Multiplayer Wiki
(category)
No edit summary
 
Line 1: Line 1:
This function will let you set further details for the [https://discordapp.com/developers/docs/rich-presence/how-to Discord Rich Presence] field for a player if they have Discord running. Each argument represents one line under the 'playing a game' section.
This function will let you set further details for the [https://discordapp.com/developers/docs/rich-presence/how-to Discord Rich Presence] field for a player if they have Discord running. Each argument represents one line under the 'playing a game' section.


== Syntax ==
[[File:UpdatedRichPresence.jpg]]
 
<br>{{ClientsideCsJsFunction}}<br>
{{JSContainer|
<syntaxhighlight lang="javascript">mp.discord.update(detailedStatus, state)</syntaxhighlight>
<syntaxhighlight lang="javascript">mp.discord.update(detailedStatus, state)</syntaxhighlight>


Line 11: Line 14:
*'''Undefined'''
*'''Undefined'''


==Example==
{{Example}}
{{ClientsideCode|
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
mp.discord.update('Playing on Freeroam', 'Playing as Ronald McDonald')
mp.discord.update('Playing on Freeroam', 'Playing as Ronald McDonald')
</syntaxhighlight>
</syntaxhighlight>
}}
}}
 
{{CSharpContainer|
Result:
<syntaxhighlight lang="csharp">RAGE.Discord.Update(string details, string state)</syntaxhighlight>
 
{{Parameters}}
[[File:UpdatedRichPresence.jpg]]
*'''details:''' String details
 
*'''state:''' String state
== See also ==
{{Example}}
* [[RAGE.Discord.Update]] - Same function in C#
<syntaxhighlight lang="C#">
 
RAGE.Discord.Update("Playing on Freeroam", "Playing as Ronald McDonald");
[[Category:Clientside API]]
</syntaxhighlight>
[[Category:Client-side Function]]
}}

Latest revision as of 10:31, 2 January 2023

This function will let you set further details for the Discord Rich Presence field for a player if they have Discord running. Each argument represents one line under the 'playing a game' section.


Client-Side Function

 C#  JavaScript



JavaScript Syntax

mp.discord.update(detailedStatus, state)

Required Arguments

  • detailedStatus: String
  • state: String

Return value

  • Undefined

Example

mp.discord.update('Playing on Freeroam', 'Playing as Ronald McDonald')


C# Syntax

RAGE.Discord.Update(string details, string state)

Parameters

  • details: String details
  • state: String state

Example

RAGE.Discord.Update("Playing on Freeroam", "Playing as Ronald McDonald");