按钮在机器人回复中有效,但在 mochawesome #bot 回复中未定义
示例 convo #bot BUTTON Pin Mailer
#me Pin 邮件程序
#bot 按钮拾取|返回菜单
#我捡起来
但在 mochawesome bot response undefined 我正在使用
botium-cli 运行 mochawesome。
按钮在机器人回复中有效,但在 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)
...