Reference des fonctions
Godot 4 · GDScript · Groups & clans
list_groups
Browses or searches public groups, ordered by member count (descending).
Asynchronous (result via signal)
Signature
list_groups(search: String = "", limit: int = 50) -> voidWhat it does
POSTs /groups/list. groups = Array of group dicts (no my_role field), sorted by member_count descending. Returns [] when there is no active session.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| search | String | "" | Optional name substring (1-50 chars). Empty lists all groups. |
| limit | int | 50 | Max results, clamped to 1-100. |
How to call it
Connect groups_listed first, then call list_groups(). Use the returned group ids with join_group() (open groups) or create_group_request() (request groups).
Result signal: groups_listed(groups: Array)
Example
Gamdato.groups_listed.connect(_on_groups)
Gamdato.list_groups("dra") # search by name
func _on_groups(groups: Array) -> void:
for grp in groups:
print("%s - %d members" % [grp.name, grp.member_count])Use cases
- Show a browseable list of clans the player can join.
- Build a search box so players can find a group by name.