messages.retrySend()

Re-attempt sending a message that previously failed. This will safely prevent sending duplicate messages if the recipient actually received the message at an earlier time.

Definition

client.messages.retrySend(
id: string|Message
):Promise<Message,Error>

Parameters

ParameterTypeDescription
idstring|MessageMessage ID or message object that you want to re-attempt

Returns

An error will be thrown if any of the arguments are invalid.

Otherwise, once the returned Promise is resolved, it will return the message. If the message has been successfully sent, message.senderStatus will be equal to MessageSenderStatus.SENT.

Example

const message = await client.messages.retrySend('some_message_id');
console.log('message was sent?', message.senderStatus === client.enums.MessageSenderStatus.SENT);