如何防止将建议操作转换为文本?
How to prevent Suggested Actions from being converted to text?
我正在使用 Node js 使用 Microsoft Botframework V4 构建一个聊天机器人。
当我用短文本向用户发送 SuggestedActions 时,它完美地工作,如图所示 Suggested Action Buttons. However, when the text of the buttons exceeds appx 20 characters they get converted to an ordered list with text.Buttons converted to text
有没有办法强制机器人发送按钮,即使文本很长?
// this works perfectly
let buttons = ["Red", "Blue", "Yello"];
return await step.prompt(CHOICE_PROMPT, "Please Choose One", buttons);
// this does not work as expected, the buttons are converted to text and are //shown in a list
let buttons = ["I like Red and Blue",
"I do not like any colo ",
"Please stop asking questions"
];
return await step.prompt(CHOICE_PROMPT, "Please Choose One", buttons);
这有效
let buttons = ["I like Red and Blue",
"I do not like any colo ",
"Please stop asking questions"
];
let suggestedActions = MessageFactory.suggestedActions([buttons], 'Please choose one')
return await step.prompt(CHOICE_PROMPT, suggestedActions);
在这里找到了最佳答案:
我正在使用 Node js 使用 Microsoft Botframework V4 构建一个聊天机器人。 当我用短文本向用户发送 SuggestedActions 时,它完美地工作,如图所示 Suggested Action Buttons. However, when the text of the buttons exceeds appx 20 characters they get converted to an ordered list with text.Buttons converted to text 有没有办法强制机器人发送按钮,即使文本很长?
// this works perfectly
let buttons = ["Red", "Blue", "Yello"];
return await step.prompt(CHOICE_PROMPT, "Please Choose One", buttons);
// this does not work as expected, the buttons are converted to text and are //shown in a list
let buttons = ["I like Red and Blue",
"I do not like any colo ",
"Please stop asking questions"
];
return await step.prompt(CHOICE_PROMPT, "Please Choose One", buttons);
这有效
let buttons = ["I like Red and Blue",
"I do not like any colo ",
"Please stop asking questions"
];
let suggestedActions = MessageFactory.suggestedActions([buttons], 'Please choose one')
return await step.prompt(CHOICE_PROMPT, suggestedActions);
在这里找到了最佳答案: