messages.findAttachment()

Retrieves more information about an attachment, such as name. This is useful for some cases (e.g. when sent from a mobile phone) where the name will still be missing.

Definition

client.messages.findAttachment(
messageId: string|Message,
attachmentId: string|number
):Promise<?MessageAttachment,Error>

Parameters

ParameterTypeDescription
messageIdstring|MessageMessage ID
attachmentIdstring|numberAttachment ID

Response

Once the returned Promise is resolved, the original message will have an updated attachments property, and a Message Attachment object will be returned.

If the message cannot be located, return null.

Example

await client.messages.findAttachment(message.id, message.attachments[0].id);