Skip to content
Yannik edited this page Oct 30, 2023 · 57 revisions

Important The GameSDK's Achievements, Applications, Voice, Images, Lobbies, Networking, Storage, and Store (purchases and discounts) features have been deprecated and will not be added.
However the rest is and will still be supported by Discord.

appleAbout MacOS Support

The plugin has been updated to Godot 4.1. The last 4.0.X release can be found here: https://github.com/vaporvee/discord-sdk-godot/releases/tag/2.3

Note To use anthing in the SDK you first need to set the app_id/Application ID with

discord_sdk.app_id = #<your Application ID>

Quick start

  1. Download the addon
  2. Put the addons/ folder in your Godot project
  3. Enable the addon in your Project Settings under "Plugins" and "DiscordSDK".
    (Also adds DiscordSDKLoader autoload wich should be ignored. It needs to run in the background to comunicate with the Discord client)
  4. Restart your project
  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.
    (Discord says you should do that but it doesn't change anything)
  7. (optional) Set images under "Rich Presence" and "Art Assets" and remember the keys
  8. Create a gdscript wich gets run for example at startup wich looks something like the following
extends Node

func _ready():
	discord_sdk.app_id = 1099618430065324082 # Application ID
	discord_sdk.details = "A demo activity by vaporvee"
	discord_sdk.state = "Checkpoint 23/23"
	
	discord_sdk.large_image = "example_game" # Image key from "Art Assets"
	discord_sdk.large_image_text = "Try it now!"
	discord_sdk.small_image = "boss" # Image key from "Art Assets"
	discord_sdk.small_image_text = "Fighting the end boss! D:"

	discord_sdk.start_timestamp = int(Time.get_unix_time_from_system()) # "02:46 elapsed"
	# discord_sdk.end_timestamp = int(Time.get_unix_time_from_system()) + 3600 # +1 hour in unix time / "01:00 remaining"

	discord_sdk.refresh() # Always refresh after changing the values!

Then it will look similar to this:

Try a built demo

Clone this wiki locally