Abdera7mane/discord-rpc-gdscript

Help with RPC

Closed this issue · 3 comments

Hello! I've been trying to integrate this into a project of mine. The thing is, I'm having trouble with figuring out how to integrate it. I've looked at the example authenticate.gd file, but it doesn't seem to be doing what I want it to do.

I just want to make it so that I can use my application ID and display the "playing a game" activity status in Discord. Any help would be greatly appreciated!

Hello, first I apology for the lack of documentation and examples, the following is a minimal script to update the rich presence I recommend you use it as an autoload singleton:

extends Node

var discord := DiscordRPC.new()
var application_id: int = 123456789012345678

func _ready() -> void:
	add_child(discord)
	discord.connect("rpc_ready", self, "_on_discord_ready")
	discord.establish_connection(application_id)


func _on_discord_ready(user: Dictionary) -> void:
	var presence := RichPresence.new()
	presence.details = "In main menu"
	presence.state = "afk"
	
	discord.get_module("RichPresence").update_presence(presence)

For other options you can check RichPresence.gd properties with the help of the Discord application rich presence visualizer it should be easy to understand what each option does

image

To remove the presence status pass null to update_presence()

@NoozSBC is the issue still relevant ?

@NoozSBC is the issue still relevant ?

Ah sorry for the lack of response, but thanks so much for the reply! It works great for me.