Activities
Variables
Anything of course begins with DiscordRPC.
e.g. DiscordRPC.app_id = #<your Application ID>
Rich presence
Name | Type | Description |
---|---|---|
app_id | int | The Application ID you need to get to make anything in the plugin → https://discord.com/developers/applications |
details | String | The first text line visible in the Activity (after the app name) |
state | String | The second text line visible in the Activity |
large_image | String | Key for the large image you set while uploading an image to the “Rich Presence” → “Art Assets” tab in your online Discord dev panel |
large_image_text | String | Text wich shows when you hover over the large image |
small_image | String | Key for the small image you set while uploading an image to the “Rich Presence” → “Art Assets” tab in your online Discord dev panel |
small_image_text | String | Text wich shows when you hover over the small image |
start_timestamp | int | The “02:46 elapsed” timestamp in the presence. Get the current time with Godot’s int(Time.get_unix_time_from_system()) and Discord counts in seconds from it |
end_timestamp | int | The “59:59 elapsed” timestamp in the presence. Get it with Godot’s int(Time.get_unix_time_from_system()) and add seconds as int e.g. + 3600 → + 1 Hour |
Invite system
The values can be pretty anything since there is no lobby system in the SDK anymore. You should already have a custom lobby system wich can compute the secret and change the values. After an invite every value should be the same as the other player.
Name | Type | Description |
---|---|---|
party_id | String | Unique identifier for the party |
current_party_size | int | The current playercount in the party |
max_party_size | int | Maximum allowed playercount in the party |
match_secret | String | Unique hash for the given match context |
join_secret | String | Unique hash for chat invites and Ask to Join |
spectate_secret | String | Unique hash for Spectate button |
is_public_party | bool | Turn it to true if you want people to join the party without asking. This needs to be enabled in the Discord user settings |
instanced | bool | Whether this activity is an instanced context, like a match |
Signals
Invite system
Activity join request
Connect it with:
Add it in your gdscript as function:
The Signal fires when someone requests to join your Activity via an request join button in Discord.
Given variable: Dictionary user_requesting
Activity join
Connect it with:
Add it in your gdscript as function:
The Signal fires when someone joins your Activity via an invite or join button in Discord.
Given variable: String secret
Send the secret to your custom system to generate the other party values and make them the same as the target user.
Activity spectate
Connect it with:
Add it in your gdscript as function:
The Signal fires when someone spectates your Activity via an invite or spectate button in Discord.
Given variable: String secret
Send the secret to your custom system to generate the other party values and make them the same as the target user.
Methods
Refresh
After setting any variables you have to reload the RPC with this method
Clear
Disables the Activity.
Taken variable: bool reset_values
Standard value: false
When turning reset_values
to true
it completely clears the whole activity with its app_id
and other values.
Unclear
Reenables the before cleared Activity. Only works with DiscordRPC.clear(reset_values = false)
(default).