Bot Framework 不直接支持 Telegram 的回复键盘功能,但您仍然可以通过消息的 channelData 字段发送它。ChannelData 用于发送未直接出现在 Bot Framework 中的特定于通道的消息。在 BotBuilder/NodeJS 中,该字段是使用 message.sourceEvent 方法设置的:
示例(未经测试):
var msg = new builder.Message(session);
msg.sourceEvent({
telegram: {
method: "sendMessage",
parameters: {
text: "This is a reply keyboard",
parse_mode: "Markdown",
reply_markup: JSON.stringify({
"keyboard": [
[{ text: "1" }, { text: "2" }, { text: "3" }],
[{ text: "4" }, { text: "5" }, { text: "6" }],
[{ text: "7" }, { text: "8" }, { text: "9" }],
[{ text: "*" }, { text: "0" }, { text: "#" }]
]
})
}
}
});
session.send(msg);
channelData 字段文档:https ://docs.botframework.com/en-us/csharp/builder/sdkreference/channels.html