Files
discord-rpc-godot/project/main.gd
2023-05-12 20:38:55 +02:00

19 lines
1.0 KiB
GDScript

extends Node
func _ready():
discord_sdk.app_id = 1099618430065324082
discord_sdk.details = "A demo activity by vaporvee#1231"
discord_sdk.state = "Checkpoint 23/23"
discord_sdk.large_image = "game"
discord_sdk.large_image_text = "Try it now!"
discord_sdk.small_image = "boss"
discord_sdk.small_image_text = "Fighting the end boss! D:"
#discord_sdk.start_timestamp = int(Time.get_unix_time_from_system())
discord_sdk.end_timestamp = int(Time.get_unix_time_from_system()) + 3600 # +1 hour in unix time
discord_sdk.refresh()
$Info.text = $Info.text.replace("{discordinfo}",str(discord_sdk.get_is_discord_working())).replace("{id}",str(discord_sdk.app_id)).replace("{details}",discord_sdk.details).replace("{state}",discord_sdk.state).replace("{lkey}",discord_sdk.large_image).replace("{ltext}",discord_sdk.large_image_text).replace("{skey}",discord_sdk.small_image).replace("{stext}",discord_sdk.small_image_text).replace("{stimestamp}",str(discord_sdk.start_timestamp)).replace("{etimestamp}",str(discord_sdk.end_timestamp))