IAttachment interface

Many messaging channels provide the ability to attach richer objects. Bot Builder lets you express these attachments in a cross channel way and connectors will do their best to render the attachments using the channels native constructs. If you desire more control over the channels rendering of a message you can use IEvent.sourceEvent to provide attachments using the channels native schema. The types of attachments that can be sent varies by channel but these are the basic types:

  • Media and Files: Basic files can be sent by setting contentType to the MIME type of the file and then passing a link to the file in contentUrl.
  • Cards: A rich set of visual cards can by setting contentType to the cards type and then passing the JSON for the card in content. If you use one of the rich card builder classes like HeroCard the attachment will automatically filled in for you.

Properties

content

(Optional) object structure of attachment.

contentType

MIME type string which describes type of attachment.

contentUrl

(Optional) reference to location of attachment content.

name

(Optional) name of the attachment.

thumbnailUrl

(Optional) link to the attachments thumbnail.

Property Details

content

(Optional) object structure of attachment.

content?: any

Property Value

any

contentType

MIME type string which describes type of attachment.

contentType: string

Property Value

string

contentUrl

(Optional) reference to location of attachment content.

contentUrl?: string

Property Value

string

name

(Optional) name of the attachment.

name?: string

Property Value

string

thumbnailUrl

(Optional) link to the attachments thumbnail.

thumbnailUrl?: string

Property Value

string