Referencia de funciones
GameMaker Studio · GML · Friends
gmda_respondInvitation
Accepts or declines an incoming friend invitation by id.
Asynchronous (result via event)
Signature
gmda_respondInvitation(invitation_id, accept_bool) -> realWhat it does
POSTs /friends/invitations/respond with action accept or decline. Returns 1 when fired, 0 with no active session. The invitation_responded event reports response.status as "accepted" or "declined"; on accept response.friendship_id is also set. On failure success is false (invitation not found, not yours to answer, no longer pending, or expired).
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| invitation_id | string | required | The invitation's id (the `id` field from a gmda_listPendingInvitations entry). |
| accept_bool | bool | required | true to accept (become friends), false to decline. |
How to call it
Fire gmda_respondInvitation(), then read invitation_responded from gmda_pollEvent(). Only the recipient of an incoming invite may respond to it.
Result event: invitation_responded { success, response }
Example
gmda_respondInvitation(invitation_id, true); // accept
// In the Step event:
var _e = gmda_pollEvent();
while (!is_undefined(_e)) {
if (_e.event == "invitation_responded") {
if (_e.success) show_debug_message("invitation " + _e.response.status);
else show_debug_message("respond failed: " + string(_e.error));
}
_e = gmda_pollEvent();
}Use cases
- Accept / decline buttons on an incoming friend request.
- Auto-decline expired invitations surfaced in the inbox.