Functions Reference
Godot 4 · GDScript · Groups & clans
leave_group
Leaves the caller's current group.
Asynchronous (result via signal)
Signature
leave_group() -> voidWhat it does
POSTs /groups/leave. status is "left" normally, or "disbanded" if the leaving member was the last/leader and the group was dissolved.
Parameters
This function takes no parameters.
How to call it
Connect group_left first, then call leave_group(). No group_id is needed; it acts on the caller's own group.
Result signal: group_left(success: bool, status: String, error_code: String)
Example
Gamdato.group_left.connect(_on_left)
Gamdato.leave_group() # status: "left" or "disbanded"
func _on_left(ok: bool, status: String, error_code: String) -> void:
if ok: print("You %s the group" % status)Use cases
- Add a 'Leave clan' button.
- Detect when leaving caused the group to be disbanded.