MessageFactory 类

定义

包含机器人可以返回的各种消息类型的实用工具方法。

public static class MessageFactory
type MessageFactory = class
Public Class MessageFactory
继承
MessageFactory

示例

// Create and send a message.
var message = MessageFactory.Text("Hello World");
await context.SendActivity(message);

注解

以下操作适用于一般消息操作。

有关邮件要发送的文本内容的限制,请参阅频道的文档。

若要控制机器人语音的各种特征,例如语音、速率、音量、发音和音调,请指定以语音合成标记语言(SSML)格式进行说话的测试。

频道决定每个卡片操作在其用户体验中的清单方式。 在大多数情况下,卡片是可单击的。 在其他人中,可以通过语音输入选择它们。 如果通道不提供交互式激活体验(例如,通过短信交互时),通道可能不支持激活。 有关如何呈现操作的决定由本文档其他位置的规范性要求(例如卡格式或建议的操作定义内)控制。

方法

Attachment(Attachment, String, String, String)

返回包含附件的邮件活动。

Attachment(IEnumerable<Attachment>, String, String, String)

返回一个邮件活动,其中包含列表中的附件集合。

Carousel(IEnumerable<Attachment>, String, String, String)

返回一个邮件活动,其中包含附件集合,作为轮播。

ContentUrl(String, String, String, String, String, String)

返回包含单个图像或视频的消息活动。

SuggestedActions(IEnumerable<CardAction>, String, String, String)

返回一条消息,其中包含一组建议的操作和可选文本。

SuggestedActions(IEnumerable<CardAction>, String, String, String, IList<String>)

返回一条消息,其中包含一组建议的操作和可选文本。

SuggestedActions(IEnumerable<String>, String, String, String)

返回一条消息,其中包含一组建议的操作和可选文本。

SuggestedActions(IEnumerable<String>, String, String, String, IList<String>)

返回一条消息,其中包含一组建议的操作和可选文本。

Text(String, String, String)

返回一个简单的短信。

适用于