vaporvee / discord-rpc-godot

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)
https://docs.vaporvee.com/discord-rpc-godot
MIT License
199 stars 10 forks source link

[Issue/Bug]: Rich Presence not updating correctly without DiscordRPC.clear(false) #74

Closed asiadwn closed 1 month ago

asiadwn commented 1 month ago

What happened?

Bug Report: Rich Presence not updating correctly without DiscordRPC.clear(false) Note: I have never reported a bug on GitHub before, so I apologize if I’m not doing it correctly.

Bug description: The Discord Rich Presence does not update correctly unless the DiscordRPC.clear(false) command is used before every change. This causes the activity in Discord to restart entirely every time, making it appear as though it resets on each update. Without using clear(), the information doesn't change at all.

Expected behavior: The Rich Presence information should update smoothly without needing to call DiscordRPC.clear(false) and without restarting the entire activity in Discord.

Current behavior: The Rich Presence only updates correctly if DiscordRPC.clear(false) is used, which causes the activity in Discord to reset on each update. Without the command, the information remains unchanged.

Version

1.3.1

Godot Version

4.3

Exact steps to reproduce this error

  1. Initialize DiscordRPC without calling DiscordRPC.clear(false).
  2. Attempt to update the Rich Presence information with new data.
  3. Observe that Discord does not update the information.
  4. When using DiscordRPC.clear(false) before each update, the information changes, but the activity resets completely.

GDScript

func _ready():
    DiscordRPC.clear(false)
    DiscordRPC.app_id = 1099618430065324082
    DiscordRPC.details = "In the menu"
    DiscordRPC.state = "In the menu"
    DiscordRPC.large_image = "menu"
    DiscordRPC.large_image_text = "menu"
    DiscordRPC.refresh()

Godot output

No response

Additional information

I’ve noticed that other games manage to update the Rich Presence continuously without this abrupt change.

Checks

vaporvee commented 1 month ago

Try to not set the app_id. It should only be set on the beginning as initialization.

asiadwn commented 1 month ago

Thank you for the suggestion! It worked perfectly everything is now updating smoothly without having to reset the app_id. I still have one question, though. If I initialize DiscordRPC.start_timestamp in one scene, how can I remove or stop it in another scene? Thanks again for your help!

vaporvee commented 1 month ago

It should reset when set to 0 but would need to look at my code for this one