Implement channel-specific functionality

In this article

Note

This topic applies to SDK v3 release. You can find the documentation for the latest version of the SDK v4 here.

Some channels provide features that cannot be implemented by using only message text and attachments. To implement channel-specific functionality, you can pass native metadata to a channel in the activity object's channel data property. For example, your bot can use the channel data property to instruct Telegram to send a sticker or to instruct Office365 to send an email.

This article describes how to use a message activity's channel data property to implement this channel-specific functionality:

Channel

Functionality

Email

Send and receive an email that contains body, subject, and importance metadata

Slack

Send full fidelity Slack messages

Facebook

Send Facebook notifications natively

Telegram

Perform Telegram-specific actions, such as sharing a voice memo or a sticker

Kik

Send and receive native Kik messages

Note

The value of an activity object's channel data property is a JSON object.
Therefore, the examples in this article show the expected format of the
channelData JSON property in various scenarios.
To create a JSON object using .NET, use the JObject (.NET) class.

Create a custom Email message

To create an email message, set the activity object's channel data property
to a JSON object that contains these properties:

When a user clicks a button within a Slack message, your bot will receive a response message
in which the channel data property is populated with a payload JSON object.
The payload object specifies contents of the original message,
identifies the button that was clicked, and identifies the user who clicked the button.

This snippet shows an example of the channelData property in the message that a bot receives
when a user clicks a button in the Slack message.

Your bot can reply to this message in the normal manner,
or it can post its response directly to the endpoint that is specified by
the payload object's response_url property.
For information about when and how to post a response to the response_url, see
Slack Buttons.

Create a Telegram message

To create a message that implements Telegram-specific actions,
such as sharing a voice memo or a sticker,
set the activity object's channel data property to a JSON object that specifies these properties:

Create a LINE message

To create a message that implements LINE-specific message types (such as sticker, templates, or LINE specific action types like opening the phone camera), set the activity object's channel data property to a JSON object that specifies LINE message types and action types.

Property

Description

type

The LINE action/message type name

These LINE message types are supported:

Sticker

Imagemap

Template (Button, confirm, carousel)

Flex

These LINE actions can be specified in the action field of the message type JSON object: