IMessage interface
A chat message sent between a User and a Bot. Messages from the bot to the user come in two flavors:
- reactive messages are messages sent from the Bot to the User as a reply to an incoming message from the user.
- proactive messages are messages sent from the Bot to the User in response to some external event like an alarm triggering.
In the reactive case the you should copy the address field from the incoming message to the outgoing message (if you use the Message builder class and initialize it with the session this will happen automatically) and then set the text or attachments. For proactive messages you’ll need save the address from the incoming message to an external storage somewhere. You can then later pass this in to UniversalBot.beginDialog() or copy it to an outgoing message passed to UniversalBot.send().
Composing a message to the user using the incoming address object will by default send a reply to the user in the context of the current conversation. Some channels allow for the starting of new conversations with the user. To start a new proactive conversation with the user simply delete the conversation field from the address object before composing the outgoing message.
- Extends
Properties
address | Address routing information for the event. Save this field to external storage somewhere to later compose a proactive message to the user. |
agent | SDK thats processing the event. Will always be 'botbuilder'. |
attachment |
Hint for how clients should layout multiple attachments. The default value is 'list'. |
attachments | For incoming messages contains attachments like images sent from the user. For outgoing messages contains objects like cards or images to send to the user. |
code | Code indicating why the conversation has ended. |
delivery |
A delivery hint to signal to the recipient alternate delivery paths for the activity. The default delivery mode is "default". |
entities | Structured objects passed to the bot or user. |
expriation | The time at which the activity should be considered to be "expired" and should not be presented to the recipient. |
importance | The importance of the activity. |
input |
Hint for clients letting them know if the bot is expecting further input or not. The built-in prompts will automatically populate this value for outgoing messages. |
label | A descriptive label for the activity. |
listen |
List of phrases and references that speech and language priming systems should listen for. |
local |
Local time when message was sent (set by client or bot, Ex: 2016-09-23T13:07:49.4714686-07:00.) |
local |
Contains the name of the timezone in which the message, in local time, expressed in IANA Time Zone database format. For example, America/Los_Angeles. |
name | Name of the operation to invoke or the name of the event. |
relates |
Reference to another conversation or message. |
reply |
The ID of the event this update is related to. |
semantic |
An optional programmatic action accompanying this request. |
source | The original source of the event (i.e. 'facebook', 'skype', 'slack', etc.) |
source |
The original event in the sources native schema. For outgoing messages can be used to pass source specific event data like custom attachments. |
speak | Spoken message as Speech Synthesis Markup Language. |
summary | Text to be displayed by as fall-back and as short description of the message content in e.g. list of recent conversations. |
text | Message text. |
text |
Format of text fields. The default value is 'markdown'. |
text |
The collection of text fragments to highlight when the activity contains a ReplyToId value. |
text |
Identified language of the message text if known. |
timestamp | UTC Time when message was sent (set by service.) |
type | Defines type of event. Should be 'message' for an IMessage. |
user | For incoming messages this is the user that sent the message. By default this is a copy of address.user but you can configure your bot with a lookupUser function that lets map the incoming user to an internal user id. |
value | Open-ended value. |
value |
The type of the activity's value object. |
Property Details
address
Address routing information for the event. Save this field to external storage somewhere to later compose a proactive message to the user.
address: IAddress
Property Value
agent
SDK thats processing the event. Will always be 'botbuilder'.
agent: string
Property Value
string
attachmentLayout
Hint for how clients should layout multiple attachments. The default value is 'list'.
attachmentLayout?: string
Property Value
string
attachments
For incoming messages contains attachments like images sent from the user. For outgoing messages contains objects like cards or images to send to the user.
attachments?: IAttachment[]
Property Value
code
Code indicating why the conversation has ended.
code?: string
Property Value
string
deliveryMode
A delivery hint to signal to the recipient alternate delivery paths for the activity. The default delivery mode is "default".
deliveryMode?: string
Property Value
string
entities
Structured objects passed to the bot or user.
entities?: any[]
Property Value
any[]
expriation
The time at which the activity should be considered to be "expired" and should not be presented to the recipient.
expriation?: string
Property Value
string
importance
The importance of the activity.
importance?: string
Property Value
string
inputHint
Hint for clients letting them know if the bot is expecting further input or not. The built-in prompts will automatically populate this value for outgoing messages.
inputHint?: string
Property Value
string
label
A descriptive label for the activity.
label?: string
Property Value
string
listenFor
List of phrases and references that speech and language priming systems should listen for.
listenFor?: string[]
Property Value
string[]
localTimestamp
Local time when message was sent (set by client or bot, Ex: 2016-09-23T13:07:49.4714686-07:00.)
localTimestamp?: string
Property Value
string
localTimezone
Contains the name of the timezone in which the message, in local time, expressed in IANA Time Zone database format. For example, America/Los_Angeles.
localTimezone?: string
Property Value
string
name
Name of the operation to invoke or the name of the event.
name?: string
Property Value
string
relatesTo
replyToId
The ID of the event this update is related to.
replyToId?: string
Property Value
string
semanticAction
An optional programmatic action accompanying this request.
semanticAction?: ISemanticAction
Property Value
source
The original source of the event (i.e. 'facebook', 'skype', 'slack', etc.)
source: string
Property Value
string
sourceEvent
The original event in the sources native schema. For outgoing messages can be used to pass source specific event data like custom attachments.
sourceEvent: any
Property Value
any
speak
summary
Text to be displayed by as fall-back and as short description of the message content in e.g. list of recent conversations.
summary?: string
Property Value
string
text
Message text.
text?: string
Property Value
string
textFormat
Format of text fields. The default value is 'markdown'.
textFormat?: string
Property Value
string
textHighlights
The collection of text fragments to highlight when the activity contains a ReplyToId value.
textHighlights?: ITextHighlight[]
Property Value
textLocale
Identified language of the message text if known.
textLocale?: string
Property Value
string
timestamp
UTC Time when message was sent (set by service.)
timestamp?: string
Property Value
string
type
Defines type of event. Should be 'message' for an IMessage.
type: string
Property Value
string
user
For incoming messages this is the user that sent the message. By default this is a copy of address.user but you can configure your bot with a lookupUser function that lets map the incoming user to an internal user id.
user: IIdentity
Property Value
value
Open-ended value.
value?: any
Property Value
any
valueType
The type of the activity's value object.
valueType?: string
Property Value
string