messages.findRecipientStatus()
Fetches all message.statusesPerRecipient
for both 1-on-1 and group messages.
Call this method when the UI needs to force redisplay of all statuses of all recipients of the message.
If there are multiple statuses being changed at once, the server may batch them automatically.
Definition
client.messages.findRecipientStatus(id: string|Message,options: ?Object):Promise<MessageStatusPerRecipient[],Error>
Parameters
Parameter | Type | Description |
---|---|---|
id | string |Object | A message ID or Message object |
options | ?Object | Options (described below) |
Options
Parameter | Type | Description |
---|---|---|
includeUsers | boolean | Whether to ensure that all users are also loaded (default: false ) |
queue | boolean | If false , do not allow this request to be batched and fetch the statuses immediately (default: true ) |
Returns
An error will be thrown if any of the arguments are invalid.
Otherwise, once the returned Promise
is resolved, returns the message.statusesPerRecipient
array (of type MessageStatusPerRecipient).
Example
const statusesPerRecipient = await client.messages.findRecipientStatus(message, { includeUsers: true });message.statusesPerRecipient.forEach(function (status) {console.log(status.user.displayName, status.status, status.createdAt);});