Discord::update: Difference between revisions
m (Added image) |
(category) |
||
| 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. | ||
==Syntax== | |||
== Syntax == | |||
<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== | ==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> | ||
}} | |||
Result: | Result: | ||
[[File:UpdatedRichPresence.jpg]] | [[File:UpdatedRichPresence.jpg]] | ||
==See also== | |||
== See also == | |||
* [[RAGE.Discord.Update]] - Same function in C# | |||
[[Category:Clientside API]] | [[Category:Clientside API]] | ||
[[Category:Client-side Function]] | |||
Revision as of 15:45, 30 April 2019
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.
Syntax
mp.discord.update(detailedStatus, state)
Required Arguments
- detailedStatus: String
- state: String
Return value
- Undefined
Example
Client-Side
mp.discord.update('Playing on Freeroam', 'Playing as Ronald McDonald')
Result:
See also
- RAGE.Discord.Update - Same function in C#
