UpdateDiscordActivity: Difference between revisions
From Onset Developer Wiki
Created page with "{{Info|Function|Client|1.2.2}} {{FuncDescription|Sets the discord activity. Requires "discord_client_id" to be set in the server config. https://discord.com/developers/docs/..." |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Info|Function|Client|1.2.2}} | {{Info|Function|Client|1.2.2}} | ||
{{FuncDescription|Sets the discord activity. Requires "discord_client_id" to be set in the server config. | {{FuncDescription|Sets the discord activity. Requires "discord_client_id" to be set in the [[server_config|server config]]. | ||
https://discord.com/developers/docs/game-sdk/activities}} | https://discord.com/developers/docs/game-sdk/activities | ||
The discord_client_id is the application id that you can find here: https://discord.com/developers/applications | |||
[[File:discord_developer.png|800px]]}} | |||
{{FuncSyntax|UpdateDiscordActivity(activity)}} | {{FuncSyntax|UpdateDiscordActivity(activity)}} | ||
Line 42: | Line 45: | ||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
*[[GetGameVersion]] | |||
*[[IsGameDevMode]] | |||
*[[IsPlayerInMainMenu]] | |||
*[[InvokeDamageFX]] | |||
*[[UpdateDiscordActivity]] | |||
*[[ConnectToServer]] |
Latest revision as of 14:46, 29 June 2021
Description
Sets the discord activity. Requires "discord_client_id" to be set in the server config.
https://discord.com/developers/docs/game-sdk/activities
The discord_client_id is the application id that you can find here: https://discord.com/developers/applications
Syntax
UpdateDiscordActivity(activity)
Parameters
- activity
Activity settings as a table.
Return Value
- Returns true on success.
Example
AddEvent("OnPackageStart", function()
local Activity = { }
Activity.state = "Test"
Activity.details = "Test2"
Activity.timestamps = { }
Activity.timestamps.start_time = 1594231268
Activity.timestamps.end_time = 0
Activity.assets = { }
Activity.assets.large_image = "avatar"
Activity.assets.large_text = "Test"
Activity.assets.small_image = ""
Activity.assets.small_text = ""
Activity.party = { }
Activity.party.id = ""
Activity.party.size = { }
Activity.party.size.current_size = 0
Activity.party.size.max_size = 0
Activity.secrets = { }
Activity.secrets.match = ""
Activity.secrets.join = ""
Activity.secrets.spectate = ""
Activity.instance = false
UpdateDiscordActivity(Activity)
end)