updated example.gd

This commit is contained in:
Yannik
2023-05-01 15:17:51 +02:00
parent 3d30849af0
commit 44fedc5b8c
4 changed files with 21 additions and 14 deletions

1
godot-cpp Submodule

Submodule godot-cpp added at feaba551b5

View File

@@ -1,17 +1,23 @@
extends Node extends Node
func _ready(): # 1. Put the addons/ folder in your Godot project
Discord_Activity.app_id = 1099618430065324082 # Application ID # 2. Enable the addon in your Project Settings under "Plugins" and "DiscordSDK". (if it doesn't show up restart your project and try again)
print("Discord working: " + str(Discord_Activity.get_is_discord_working())) # A boolean if everything worked # 3. Restart your project
Discord_Activity.details = "A demo activity by vaporvee#1231" # 4. Create an Application under https://discord.com/developers/applications and get the Application ID
Discord_Activity.state = "Checkpoint 23/23" # 5. (optional) Set images under "Rich Presence" and "Art Assets" and remember the keys
Discord_Activity.large_image = "game" # Image key from "Art Assets"
Discord_Activity.large_image_text = "Try it now!"
Discord_Activity.small_image = "boss" # Image key from "Art Assets"
Discord_Activity.small_image_text = "Fighting the end boss! D:"
Discord_Activity.start_timestamp = int(Time.get_unix_time_from_system()) # "02:41 elapsed"
# Discord_Activity.end_timestamp = int(Time.get_unix_time_from_system()) + 3600 # +1 hour in unix time
Discord_Activity.refresh() # Always refresh after changing the values! func _ready():
DiscordSDK.app_id = 1099618430065324082 # Application ID
print("Discord status: " + DiscordSDK.get_sdk_info()) # Returns "Ok" if everything worked
DiscordSDK.details = "A demo activity by vaporvee#1231"
DiscordSDK.state = "Checkpoint 23/23"
DiscordSDK.large_image = "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:"
DiscordSDK.start_timestamp = int(Time.get_unix_time_from_system()) # "02:41 elapsed"
# Discord_Activity.end_timestamp = int(Time.get_unix_time_from_system()) + 3600 # +1 hour in unix time
DiscordSDK.refresh() # Always refresh after changing the values!