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
Line 42: Line 42:


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
*[[GetGameVersion]]
*[[IsGameDevMode]]
*[[IsPlayerInMainMenu]]
*[[InvokeDamageFX]]
*[[UpdateDiscordActivity]]
*[[ConnectToServer]]

Revision as of 18:39, 30 August 2020

UpdateDiscordActivity

Type: Function
Context: Client
Introduced: v1.2.2

Description

Sets the discord activity. Requires "discord_client_id" to be set in the server config.

https://discord.com/developers/docs/game-sdk/activities

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)

See also