renamed discord rpc plugin

This commit is contained in:
2024-03-30 13:59:10 +01:00
parent 67e80e2eed
commit 05421f6c2e
8 changed files with 64 additions and 61 deletions

View File

@@ -1,17 +1,17 @@
---
layout: ../../../layouts/DocsLayout.astro
repo: discord-sdk-godot
repo: discord-rpc-godot
title: Activities
---
# Variables
Anything of course begins with `DiscordSDK.{:gdscript}` e.g. `DiscordSDK.app_id = #<your Application ID>{:gdscript}`
Anything of course begins with `DiscordRPC.{:gdscript}` e.g. `DiscordRPC.app_id = #<your Application ID>{:gdscript}`
### Rich presence
| Name | Type | Description |
| --- | --- | --- |
| `app_id{:gdscript}` | `int{:gdscript}` | The Application ID you need to get to make anything in the SDK → https://discord.com/developers/applications |
| `app_id{:gdscript}` | `int{:gdscript}` | The Application ID you need to get to make anything in the plugin → https://discord.com/developers/applications |
| `details{:gdscript}` | `String{:gdscript}` | The first text line visible in the Activity (after the app name) |
| `state{:gdscript}` | `String{:gdscript}` | The second text line visible in the Activity |
| `large_image{:gdscript}` | `String{:gdscript}` | Key for the large image you set while uploading an image to the "Rich Presence" → "Art Assets" tab in your online Discord dev panel |
@@ -41,20 +41,20 @@ The values can be pretty anything since there is no lobby system in the SDK anym
### Activity join request
**Connect it with:**
```gdscript
DiscordSDK.connect("activity_join_request",_on_activity_join_request)
DiscordRPC.connect("activity_join_request",_on_activity_join_request)
```
**Add it in your gdscript as function:**
```gdscript
func _on_activity_join_request(user_requesting):
```
The Signal fires when someone requests to join your Activity via an request join button in Discord.<br/>
**Given variable:** [`Dictionary user_requesting{:gdscript}`](/docs/discord-sdk-godot/users#get-current-user)
**Given variable:** [`Dictionary user_requesting{:gdscript}`](/docs/discord-rpc-godot/users#get-current-user)
<br/>
<br/>
### Activity join
**Connect it with:**
```gdscript
DiscordSDK.connect("activity_join",_on_activity_join)
DiscordRPC.connect("activity_join",_on_activity_join)
```
**Add it in your gdscript as function:**
```gdscript
@@ -68,7 +68,7 @@ Send the secret to your custom system to generate the other party values and mak
### Activity spectate
**Connect it with:**
```gdscript
DiscordSDK.connect("activity_spectate",_on_activity_spectate)
DiscordRPC.connect("activity_spectate",_on_activity_spectate)
```
**Add it in your gdscript as function:**
```gdscript
@@ -79,20 +79,20 @@ The Signal fires when someone spectates your Activity via an invite or spectate
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 SDK with this method
After setting any variables you have to reload the RPC with this method
```gdscript
DiscordSDK.refresh()
DiscordRPC.refresh()
```
### Clear
Disables the Activity.
```gdscript
DiscordSDK.clear(reset_values)
DiscordRPC.clear(reset_values)
```
**Taken variable:** `bool reset_values{:gdscript}` **Standard value:** `false{:gdscript}`<br/>
When turning `reset_values{:gdscript}` to `true{:gdscript}` it completely clears the whole activity with its `app_id{:gdscript}` and other values.
### Unclear
Reenables the before cleared Activity. Only works with `DiscordSDK.clear(reset_values = false){:gdscript}`(default).
Reenables the before cleared Activity. Only works with `DiscordRPC.clear(reset_values = false){:gdscript}`(default).
```gdscript
DiscordSDK.unclear()
DiscordRPC.unclear()
```

View File

@@ -1,6 +1,6 @@
---
layout: ../../../layouts/DocsLayout.astro
repo: discord-sdk-godot
repo: discord-rpc-godot
title: Building
---

View File

@@ -1,10 +1,10 @@
---
layout: ../../../layouts/DocsLayout.astro
repo: discord-sdk-godot
repo: discord-rpc-godot
title: Debug
---
The ![](https://raw.githubusercontent.com/vaporvee/discord-sdk-godot/main/project/addons/discord-sdk-gd/Debug.svg)`DiscordSDKDebug{:gdscript}` Node shows the current status of the SDK and its values.<br/>
The ![](https://raw.githubusercontent.com/vaporvee/discord-rpc-godot/main/project/addons/discord-rpc-gd/Debug.svg)`DiscordRPCDebug{:gdscript}` Node shows the current status of the Plugin and its values.<br/>
You can also print the `current_user{:gdscript}` Dictionary or the whole friendslist Array on the console and manage invites with the Button and input LineEdits. You can also disable and enable the Activity with the button switch.
![debug_node](https://github.com/vaporvee/discord-sdk-godot/assets/80621863/d0048066-ef68-4900-8e38-4638d2236d16)
![debug_node](https://github.com/vaporvee/discord-rpc-godot/assets/80621863/d0048066-ef68-4900-8e38-4638d2236d16)

View File

@@ -1,20 +1,20 @@
---
layout: ../../../layouts/DocsLayout.astro
repo: discord-sdk-godot
repo: discord-rpc-godot
title: Editor Presence
---
<img width="80%" src="https://raw.githubusercontent.com/vaporvee/discord-sdk-godot/main/project/assets/GodotEditorPresenceBanner.svg" />
<img width="80%" src="https://raw.githubusercontent.com/vaporvee/discord-rpc-godot/main/project/assets/GodotEditorPresenceBanner.svg" />
<br/>
<br/>
***
**Enabling it:**
1. Enable the DiscordSDK addon (and restart the editor like in the quickstart guide)
1. Enable the DiscordRPC addon (and restart the editor like in the quickstart guide)
2. Go to the **editor** settings
3. and enable `"DiscordSDK/EditorPresence/enabled"{:gdscript}`<br/>
3. and enable `"DiscordRPC/EditorPresence/enabled"{:gdscript}`<br/>
Editor Presence also updates a bit slower on client side. Your friends will see what you are doing in the exact second even when its not updated for you directly.
***
(old image)
<img width="50%" src="https://github.com/vaporvee/discord-sdk-godot/assets/80621863/72b85ea7-24f1-4136-b788-92590c165a55" />
<img width="50%" src="https://github.com/vaporvee/discord-rpc-godot/assets/80621863/72b85ea7-24f1-4136-b788-92590c165a55" />

View File

@@ -1,9 +1,9 @@
---
layout: ../../../layouts/DocsLayout.astro
repo: discord-sdk-godot
repo: discord-rpc-godot
has_thumbnail: true
title: Home
subtitle: Discord Game SDK support for GDScript in Godot Engine 4.2. with the easiest code pattern!
subtitle: Discord RPC Plugin for GDScript with an easy-to-use code pattern in Godot Engine 4, with optional Editor Rich Presence! (Compatible with Linux, Windows, & MacOS)
features: [
"Activities (Make people see what you are playing)",
"Invites",
@@ -15,27 +15,30 @@ features: [
]
---
:::note{title="Important Discord Game SDK information"}
:::deter{title="Important plugin explaination"}
**This is for the Discord Game SDK NOT the Embedded App SDK** <br/>
Any mention of "SDK" has nothing to do with making Discord voice channel activities. <br/>
Its only to display your game in a Discord user's profile with extra information and some other features.
:::
:::note{title="Discord Game SDK information"}
The GameSDK's Achievements, Applications, Voice, Images, Lobbies, Networking, Storage, and Store (purchases and discounts) features have been deprecated and will not be added. <br /> However the rest is and will still be supported by Discord.
:::
:::warn
The plugin only works with 4.2 and above for the current version
:::
<br/>
:::assert{title="Important info"}
:::assert{title="Keep in mind"}
To make anything work in the plugin make sure to run
```gdscript
func _process(_delta):
DiscordSDK.run_callbacks()
DiscordRPC.run_callbacks()
```
This happens normaly inside the Autoload wich should be automatically added by the plugin. <br />
Something that does **not get added automatically** is your `app_id{:gdscript}`. It is also mandatory to be able to use anything in the plugin.
```gdscript
DiscordSDK.app_id = #<your Application ID>
DiscordRPC.app_id = #<your Application ID>
```
:::
@@ -43,10 +46,10 @@ To make anything work in the plugin make sure to run
| Recommended | Manual |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <ol type="1"><li>Open the AssetLib tab in your Godot Editor.</li><li>Search for "discord" and install all the files from this plugin <img width="30px" style="margin-top:-30px;" src="https://raw.githubusercontent.com/vaporvee/discord-sdk-godot/main/project/assets/Logo_V2_Clyde.png" /></li></ol> | <ol type="1"><li>[Download the addon](https://github.com/vaporvee/discord-sdk-godot/releases/latest/download/ADDON-Discord-SDK-Godot.zip/)</li><li>Put the `addons/` folder in the root of your Godot project</li></ol> |
| <ol type="1"><li>Open the AssetLib tab in your Godot Editor.</li><li>Search for "discord" and install all the files from this plugin <img width="30px" style="margin-top:-30px;" src="https://raw.githubusercontent.com/vaporvee/discord-rpc-godot/main/project/assets/Logo_V2_Clyde.png" /></li></ol> | <ol type="1"><li>[Download the addon](https://github.com/vaporvee/discord-rpc-godot/releases/latest/download/ADDON-discord-rpc-godot.zip/)</li><li>Put the `addons/` folder in the root of your Godot project</li></ol> |
3. Enable the addon in your Project Settings under "Plugins" and "DiscordSDK". <br /><sub>(Also adds DiscordSDKLoader autoload wich should be ignored. It needs to run in the background to comunicate with the Discord client)</sub>
4. Restart your project with the window that should now appear. <br /><img src="https://github.com/vaporvee/discord-sdk-godot/assets/80621863/620d90aa-6e76-4a80-980e-c8c57d8cfa58" width="200px" /><br />
3. Enable the addon in your Project Settings under "Plugins" and "DiscordRPC". <br /><sub>(Also adds DiscordRPCLoader autoload wich should be ignored. It needs to run in the background to comunicate with the Discord client)</sub>
4. Restart your project with the window that should now appear. <br /><img src="https://github.com/vaporvee/discord-rpc-godot/assets/80621863/620d90aa-6e76-4a80-980e-c8c57d8cfa58" width="200px" /><br />
5. Create an Application under https://discord.com/developers/applications and get the Application ID
6. While you're here, head to the "OAuth2" section of your application and add `http://127.0.0.1` as a redirect URI for your application.<br /><sub>(Discord says you should do that but it doesn't change anything)</sub>
7. (optional) Set images under "Rich Presence" and "Art Assets" and remember the keys
@@ -56,28 +59,28 @@ To make anything work in the plugin make sure to run
extends Node
func _ready():
DiscordSDK.app_id = 1099618430065324082 # Application ID
DiscordSDK.details = "A demo activity by vaporvee"
DiscordSDK.state = "Checkpoint 23/23"
DiscordRPC.app_id = 1099618430065324082 # Application ID
DiscordRPC.details = "A demo activity by vaporvee"
DiscordRPC.state = "Checkpoint 23/23"
DiscordSDK.large_image = "example_game" # Image key from "Art Assets"
DiscordSDK.large_image_text = "Try it now!"
DiscordSDK.small_image = "boss" # Image key from "Art Assets"
DiscordSDK.small_image_text = "Fighting the end boss! D:"
DiscordRPC.large_image = "example_game" # Image key from "Art Assets"
DiscordRPC.large_image_text = "Try it now!"
DiscordRPC.small_image = "boss" # Image key from "Art Assets"
DiscordRPC.small_image_text = "Fighting the end boss! D:"
DiscordSDK.start_timestamp = int(Time.get_unix_time_from_system()) # "02:46 elapsed"
# DiscordSDK.end_timestamp = int(Time.get_unix_time_from_system()) + 3600 # +1 hour in unix time / "01:00:00 remaining"
DiscordRPC.start_timestamp = int(Time.get_unix_time_from_system()) # "02:46 elapsed"
# DiscordRPC.end_timestamp = int(Time.get_unix_time_from_system()) + 3600 # +1 hour in unix time / "01:00:00 remaining"
DiscordSDK.refresh() # Always refresh after changing the values!
DiscordRPC.refresh() # Always refresh after changing the values!
```
**Then it will look similar to this:**
<img width="400px" src="https://raw.githubusercontent.com/vaporvee/discord-sdk-godot/main/project/assets/ActivityPreview.svg" />
<img width="400px" src="https://raw.githubusercontent.com/vaporvee/discord-rpc-godot/main/project/assets/ActivityPreview.svg" />
[**Try a built demo**](https://github.com/vaporvee/discord-sdk-godot/releases/latest/download/Demo-Export.zip)<br /><br />
[**Try a built demo**](https://github.com/vaporvee/discord-rpc-godot/releases/latest/download/Demo-Export.zip)<br /><br />
# Troubleshooting
First of all try reinstalling the plugin and restart both your Godot Editor and your Discord client.
<details><summary><b>I have no errors in my Godot console from the plugin but my Activity doesn't show up in my Discord Client.</b></summary>Make sure a `DiscordSDK.run_callbacks()` function runs in a `_process(delta)` function. This should happen in the Autoload added by the plugin. If it still doesn't help, try the Demo above. If still nothing appears in your Discord profile card, you have to reset the depending settings in you Discord or reinstall it.</details>
<details><summary><b>I have a lot of `DiscordSDK not declared` errors spammed in my Godot Console and i can't use the plugin.</b></summary> Make sure the plugin is actually enabled. Then the plugin should work and after the second restart you shouldn't get any errors from the plugin. But if it still gives you the errors delete the file `/addons/discord-sdk-gd/bin/.gdignore` and restart the editor manually.</details>
<details><summary><b>I have no errors in my Godot console from the plugin but my Activity doesn't show up in my Discord Client.</b></summary>Make sure a `DiscordRPC.run_callbacks()` function runs in a `_process(delta)` function. This should happen in the Autoload added by the plugin. If it still doesn't help, try the Demo above. If still nothing appears in your Discord profile card, you have to reset the depending settings in you Discord or reinstall it.</details>
<details><summary><b>I have a lot of `DiscordRPC not declared` errors spammed in my Godot Console and i can't use the plugin.</b></summary> Make sure the plugin is actually enabled. Then the plugin should work and after the second restart you shouldn't get any errors from the plugin. But if it still gives you the errors delete the file `/addons/discord-rpc-gd/bin/.gdignore` and restart the editor manually.</details>

View File

@@ -1,6 +1,6 @@
---
layout: ../../../layouts/DocsLayout.astro
repo: discord-sdk-godot
repo: discord-rpc-godot
title: Relationship Manager
---
# Variables
@@ -10,7 +10,7 @@ Type: `Dictionary{:gdscript}`
| Key | Type | Description |
| --- | --- | --- |
| `"type"{:gdscript}` | `String{:gdscript}` | <details><summary>The type of relationship the current user has with the given user. These are:</summary> `"None"` user has no intrinsic relationship<br/>`"Friend"` user is a friend<br/>`"Blocked"` user is blocked<br/>`"PendingIncoming"` user has a pending incoming friend request to connected user<br/>`"PendingOutgoing"` current user has a pending outgoing friend request to user<br/>`"Implicit"` user is not friends, but interacts with current user often (frequency + recency)<br/>`"NotAvailable"` relationship is unknown<br/></details> |
| `"user"{:gdscript}` | `Dictionary{:gdscript}` | [user](/docs/discord-sdk-godot/users#get-current-user) |
| `"user"{:gdscript}` | `Dictionary{:gdscript}` | [user](/docs/discord-rpc-godot/users#get-current-user) |
| `"presence"{:gdscript}` | `Dictionary{:gdscript}` | Will be described below. |
### presence
@@ -18,14 +18,14 @@ Type: `Dictionary{:gdscript}`
| Name | Type | Description |
| --- | --- | --- |
| `"status"{:gdscript}` | `String{:gdscript}` | <details><summary>The user status:</summary>`"Offline"`<br/>`"Online"`<br/>`"Idle"`<br/>`"DoNotDisturb"`<br/>`"NotAvailable"`<br/></details> |
| `"activity"{:gdscript}` | `Dictionary{:gdscript}` | All [activity](/docs/discord-sdk-godot/activities) values and the `"name"{:gdscript}` of the activity
| `"activity"{:gdscript}` | `Dictionary{:gdscript}` | All [activity](/docs/discord-rpc-godot/activities) values and the `"name"{:gdscript}` of the activity
# Signals
### Relationship init
**Connect it with:**
```gdscript
DiscordSDK.connect("relationships_init",_on_relationships_init)
DiscordRPC.connect("relationships_init",_on_relationships_init)
```
**Add it in your gdscript as function:**
```gdscript
@@ -36,7 +36,7 @@ The Signal fires when Discord is ready to offer relationship information.<br/>
### Updated relationship
**Connect it with:**
```gdscript
DiscordSDK.connect("updated_relationship",_on_updated_relationship)
DiscordRPC.connect("updated_relationship",_on_updated_relationship)
```
**Add it in your gdscript as function:**
```gdscript
@@ -49,7 +49,7 @@ For example activity details update, avatar update, username update, online, off
### Get relationship
Returns the relationship between the current user and the `user_id{:gdscript}`
```gdscript
DiscordSDK.get_relationship(user_id)
DiscordRPC.get_relationship(user_id)
```
**Taken variable:** `int user_id{:gdscript}`<br/>
**Given variable:** `Dictionary relationship{:gdscript}`
@@ -57,6 +57,6 @@ DiscordSDK.get_relationship(user_id)
### Get all relationships
Returns all relationships the current user has. Warning: this will be many! (if not I'm sorry xD)
```gdscript
DiscordSDK.get_all_relationships()
DiscordRPC.get_all_relationships()
```
**Given variable:** `Dictionary relationship{:gdscript}`

View File

@@ -1,6 +1,6 @@
---
layout: ../../../layouts/DocsLayout.astro
repo: discord-sdk-godot
repo: discord-rpc-godot
title: Users
---
# Methods
@@ -9,7 +9,7 @@ title: Users
Fetch information about the currently to the Discord client connected user account.<br/>
Note: This doesn't return the proper values when the game is not fully connected to the Discord client. Give it its time!
```gdscript
DiscordSDK.get_current_user()
DiscordRPC.get_current_user()
```
Returns `Dictionary current_user{:gdscript}`

View File

@@ -1,25 +1,25 @@
---
layout: ../../../layouts/DocsLayout.astro
repo: discord-sdk-godot
repo: discord-rpc-godot
title: Utillity or other stuff
---
# Methods
## Run callbacks
```gdscript
func _process(_delta):
DiscordSDK.run_callbacks()
DiscordRPC.run_callbacks()
```
This runs normaly inside the Autoload `DiscordSDKLoader{:gdscript}` wich should be automatically added by the plugin. If not this needs to be added to use most features of the plugin. In older versions of the plguin known as `discord_sdk.run_callbacks(){:gdscript}`.
This runs normaly inside the Autoload `DiscordRPCLoader{:gdscript}` wich should be automatically added by the plugin. If not this needs to be added to use most features of the plugin. In older versions of the plguin known as `discord_sdk.run_callbacks(){:gdscript}`.
## Register game
### Register Steam
Registers your game's Steam app id for the protocol `steam://run-game-id/<id>` when you are shipping your game on steam. Used when Discord wants to launch your game or to push the Discord overlay to your game.
```gdscript
DiscordSDK.register_steam(1938123)
DiscordRPC.register_steam(1938123)
```
Requires a steamID `int{:gdscript}` value
### Register command
Registers your game's launch command. Used when Discord wants to launch your game or to push the Discord overlay to your game. Only really makes sense when the command works on the given OS
```gdscript
DiscordSDK.register_command("my-awesome-game://run --full-screen")
DiscordRPC.register_command("my-awesome-game://run --full-screen")
```
Requires a launch command `String{:gdscript}` value