Справочник функций
Godot 4 · GDScript · Groups & clans
send_group_invite
Invites a player to the caller's group (requires the can_invite permission).
Asynchronous (result via signal)
Signature
send_group_invite(player_key: String, message: String = "") -> voidWhat it does
POSTs /groups/invitations/send. On success invitation = {id, group_id, to_player_key, to_player_name, status, message, created_at, expires_at}; {} on failure. error_code may be not_invitable / duplicate_pending / group_full / insufficient_rank / not_found.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| player_key | String | required | Key of the player to invite. |
| message | String | "" | Optional note (sanitized to max 200 chars). |
How to call it
Connect group_invite_sent first, then call send_group_invite(). The caller needs the can_invite permission. This is the group-to-player direction; the player responds with respond_group_invitation().
Result signal: group_invite_sent(success: bool, invitation: Dictionary, error_code: String)
Example
Gamdato.group_invite_sent.connect(_on_g_invite)
Gamdato.send_group_invite(player_key, "Join us!")
func _on_g_invite(ok: bool, invitation: Dictionary, error_code: String) -> void:
if ok: print("Invited %s" % invitation.to_player_name)
else: print("Failed: %s" % error_code)Use cases
- Let officers invite a friend into the clan.
- Recruit a player straight from their profile screen.