chatbot - 使用 mochawesome 的 Botium-cli 对话流:未定义的按钮
问题描述
按钮在机器人回复中有效,但在 mochawesome #bot 回复中未定义
示例 convo #bot BUTTON Pin Mailer
#me Pin 邮件程序
#bot 按钮拾取|返回菜单
#我捡起来
但在 mochawesome bot response undefined 我正在使用
botium-cli 运行 mochawesome。
解决方案
目前,Botium CLI 中的 mochawesome 记者仅使用文本消息。
请参阅Github 存储库:
...
const messageLog = []
const attachmentsLog = []
const listenerMe = (container, msg) => {
messageLog.push('#me: ' + msg.messageText)
if (msg.attachments) attachmentsLog.push(...msg.attachments)
}
const listenerBot = (container, msg) => {
messageLog.push('#bot: ' + msg.messageText)
if (msg.attachments) attachmentsLog.push(...msg.attachments)
}
const listenerAttachments = (container, attachment) => {
attachmentsLog.push(attachment)
}
driver.on('MESSAGE_SENTTOBOT', listenerMe)
driver.on('MESSAGE_RECEIVEDFROMBOT', listenerBot)
driver.on('MESSAGE_ATTACHMENT', listenerAttachments)
...
推荐阅读
- python - Python海龟文件“
",第 5 行,在笔下 - c# - '无法从节点连接读取描述符:' C# VS Code 2019 项目中的错误
- python - 如何获取名称和首选项字符串并将它们添加到以名称为键的字典中?
- python - 如何创建具有排列的行和列的二维列表(矩阵)
- mysql - 在 MySQL 中按时间线性分布的样本 n 行
- kotlin - 为什么作者可以通过 update 将新对象重新分配给 val?
- rust - 为什么我得到“不能一次多次借用 `arr[_]` 作为可变变量”?
- javascript - 如何将一组对象合并到一个数组中,然后过滤掉重复项
- react-native - 反应原生谷歌登录
- python - 递归地展平具有低指针和高指针的嵌套整数列表