Skip to main content
Version: 1.4

Event

Bottender event helps you determine what kind of message is sent from user.

You can access context.event object within your handlers as the following example shows.

async function MyAction(context) {
if (context.event.isText) {
await context.sendText('I know you sent text message.');
} else {
await context.sendText('I know you did not send text message.');
}
}

For platform specific events, please check out following links:

PlatformDoc
ConsoleAPIReference-ConsoleEvent
MessengerAPIReference-MessengerEvent
LINEAPIReference-LineEvent
SlackAPIReference-SlackEvent
TelegramAPIReference-TelegramEvent
ViberAPIReference-ViberEvent

rawEvent

Underlying raw event.

Example:

event.rawEvent;
// {
// ...
// }

isMessage

Determine if the event is a message event.

Example:

event.isMessage; // true

message

The message object from Messenger raw event.

Example:

event.message;
// {
// ...
// text: 'Awesome.',
// }

isText

Determine if the event is a message event which includes text.

Example:

event.isText; // true

text

The text string from Messenger raw event.

Example:

event.text; // 'Awesome.'