Referencia de funciones
Godot 4 · GDScript · Groups & clans
respond_group_invitation
Accepts or declines a group invitation addressed to the caller.
Asynchronous (result via signal)
Signature
respond_group_invitation(invitation_id: String, accept: bool) -> voidWhat it does
POSTs /groups/invitations/respond. status = "accepted" | "declined"; group_id is present on accept. error_code may be not_pending / expired / already_in_group / group_full / not_found.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| invitation_id | String | required | Id of the invitation to respond to. |
| accept | bool | required | true to accept (join the group), false to decline. |
How to call it
Connect group_invitation_responded first, then call respond_group_invitation(). Only the invitee may respond; get ids from list_group_invitations("incoming").
Result signal: group_invitation_responded(success: bool, status: String, group_id: String, error_code: String)
Example
Gamdato.group_invitation_responded.connect(_on_g_resp)
Gamdato.respond_group_invitation(invitation_id, true) # accept
func _on_g_resp(ok: bool, status: String, group_id: String, error_code: String) -> void:
if ok and status == "accepted": print("Joined %s" % group_id)Use cases
- Wire Accept / Decline buttons on an invite card.
- Auto-join the player into the group once they accept.