Discord::update: Difference between revisions
(Created page with "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 'play...") |
No edit summary |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
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. | 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. | ||
[[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> | ||
=== Required Arguments === | === Required Arguments === | ||
*'''detailedStatus:''' String | *'''detailedStatus:''' {{RageType|String}} | ||
*'''state:''' String | *'''state:''' {{RageType|String}} | ||
===Return value=== | |||
=== Return value === | |||
*'''Undefined''' | *'''Undefined''' | ||
{{Example}} | |||
<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| | |||
<syntaxhighlight lang="csharp">RAGE.Discord.Update(string details, string state)</syntaxhighlight> | |||
{{Parameters}} | |||
*'''details:''' String details | |||
*'''state:''' String state | |||
{{Example}} | |||
<syntaxhighlight lang="C#"> | |||
RAGE.Discord.Update("Playing on Freeroam", "Playing as Ronald McDonald"); | |||
</syntaxhighlight> | |||
}} | |||
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
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");
