Reference des fonctions
Godot 4 · GDScript · Friends
remove_friend
Removes an existing friendship by player key.
Asynchronous (result via signal)
Signature
remove_friend(player_key: String) -> voidWhat it does
POSTs /friends/remove. On failure error_code is one of not_friends (they aren't actually a friend) / not_found / internal.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| player_key | String | required | The key of the friend to remove (echoed back in the signal). |
How to call it
Connect friend_removed first, then call remove_friend(). No-op with error_code internal when there is no active session or the key is empty.
Result signal: friend_removed(success: bool, player_key: String, error_code: String)
Example
Gamdato.friend_removed.connect(_on_removed)
Gamdato.remove_friend(player_key)
func _on_removed(ok: bool, key: String, error_code: String) -> void:
if ok: print("friend removed")
else: print("failed: %s" % error_code)Use cases
- Unfriend button on a friend's row in the social menu.
- Let a player prune their friends list.