Godot Discord Game SDK integration using GDNative. Supports 💰Windows & 🐧Linux.
func update_activity() -> void:
var activity = Discord.Activity.new()
activity.set_type(Discord.ActivityType.Playing)
activity.set_state("Reached: 2-2")
activity.set_details("Loadout: grenade + rail gun")
var assets = activity.get_assets()
assets.set_large_image("zone2")
assets.set_large_text("ZONE 2 WOOO")
assets.set_small_image("capsule_main")
assets.set_small_text("ZONE 2 WOOO")
var result = yield(Discord.activity_manager.update_activity(activity), "result").result
if result != Discord.Result.Ok:
push_error(result)
func create_lobby():
var transaction := Discord.lobby_manager.get_lobby_create_transaction()
transaction.set_capacity(2)
transaction.set_type(Discord.LobbyType.Private)
transaction.set_locked(false)
var result = yield(Discord.lobby_manager.create_lobby(transaction), "result")
if result.result != Discord.Result.Ok:
push_error(result.result)
return
var lobby = result.data
Discord.lobby_manager.send_lobby_message(lobby.get_id(), "hello people!")