Skip to content

Getting started


Quick start

  1. Open the AssetLib tab in your Godot Editor.
  2. Search for “discord” and install all the files from this plugin

  3. Enable the addon in your Project Settings under “Plugins” and “DiscordRPC”.

    (Also adds DiscordRPCLoader autoload wich should be ignored. It needs to run in the background to comunicate with the Discord client)

  4. Restart your project with the window that should now appear.

  5. 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. (Discord says you should do that but it doesn’t change anything)

  6. (optional) Set images under “Rich Presence” and “Art Assets” and remember the keys

  7. Create a gdscript wich gets run for example at startup wich looks something like the following

extends Node
func _ready():
DiscordRPC.app_id = 1099618430065324082 # Application ID
DiscordRPC.details = "A demo activity by vaporvee"
DiscordRPC.state = "Checkpoint 23/23"
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:"
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"
DiscordRPC.refresh() # Always refresh after changing the values!

Then it will look similar to this:

Download the addon

Troubleshooting

First of all try reinstalling the plugin and restart both your Godot Editor and your Discord client. Or try to install the demo above and see if it works. If you still have problems, check the following:

I did everything right got no error but the Discord RPC Activity still doesn’t show up. Check that Discord Settings -> Activity Privacy -> Share your detected activities with others is eneabled in your Discord client.
Discord Settings Screenshot
I have no errors in my Godot console from the plugin but my Activity doesn’t show up in my Discord Client.Make sure a DiscordSDK.run_callbacks() function runs in a _process(delta) function. This should happen in the Autoload added by the plugin.

I have a lot of DiscordSDK not declared errors spammed in my Godot Console and i can’t use the plugin. 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 this .gdignore file in your file explorer (will not be shown in the Godot Editor)

  • Directoryaddons/
    • Directorydiscord-rpc-gd/
      • Directorybin/
        • .gdignore
  • icon.svg
  • project.godot

and restart the editor manually.

I downloaded Discord via Flatpak and it doesn’t work. You can enable Rich Presence support by creating a symlink for a file Discord uses for RPC communication. You can see instructions on how to do that here.

I can’t get my game working with this plugin on a platform which isn’t supported by it. You would need to disable the plugin (that means never instantiate a scene containing its code). You do that with a custom manager. Here is a good example:

func is_discord_rpc_supported() -> bool:
return game_platform == GamePlatform.PC and GDExtensionManager.is_extension_loaded("res://addons/discord-rpc-gd/bin/discord-rpc-gd.gdextension")
func _init_discord_rpc():
if not is_discord_rpc_supported():
return
var discord_rich_presence_scene: PackedScene = load("res://scenes/integration/discord_rich_presence.tscn")
discord_rich_presence = discord_rich_presence_scene.instantiate()
add_child(discord_rich_presence)
discord_rich_presence.initialize()