Referência de funções
GameMaker Studio · GML · Groups & clans
gmda_listGroupInvitations
Lists group invitations, incoming or outgoing.
Asynchronous (result via event)
Signature
gmda_listGroupInvitations([direction="incoming"], [status="pending"], [limit=50]) -> realWhat it does
POSTs /groups/invitations/list, then queues group_invitations_listed { success, response }. e.response is the raw server body: the list of invitations, { id, direction, group_id, group_name, counterpart, status, message, created_at, ... }, is the array at e.response.invitations. Returns 0 (and queues nothing) when there is no active session.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| direction | string | "incoming" | "incoming" (invites to you) or "outgoing" (invites your group sent). |
| status | string | "pending" | Filter: pending / accepted / declined / cancelled / expired. |
| limit | real | 50 | Max results, clamped to 1-100. |
How to call it
Call it, then read the array from e.response.invitations on the group_invitations_listed event in gmda_pollEvent(). Use each returned id with gmda_respondGroupInvitation() (incoming) or gmda_cancelGroupInvitation() (outgoing).
Result event: group_invitations_listed { success, response }
Example
gmda_listGroupInvitations("incoming"); // -> group_invitations_listed
var e = gmda_pollEvent();
while (!is_undefined(e)) {
if (e.event == "group_invitations_listed" && e.success) {
var invites = e.response.invitations; // the list lives at response.invitations
for (var i = 0; i < array_length(invites); i++) {
show_debug_message(invites[i].group_name + " invited you");
}
}
e = gmda_pollEvent();
}Use cases
- Show a player their pending clan invites.
- Let leaders review the invitations their group has sent out.