We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
规则里面写了
//所有消息都无法匹配时的fallback webot.set(/.*/, function(info){ // 利用 error log 收集听不懂的消息,以利于接下来完善规则 // 你也可以将这些 message 存入数据库 log('unhandled message: %s', info.text); info.flag = true; return '你发送了「' + info.text + '」,可惜我太笨了,听不懂. 发送: help 查看可用的指令'; });
还是不能识别自定义的规则 比如
/ 可以通过回调返回结果 webot.set('search', { description: '发送: s 关键词 ', pattern: /^(?:搜索?|search|百度|s\b)\s*(.+)/i, //handler也可以是异步的 handler: do_search });
是什么原因呢?
Don't know what you are saying
The text was updated successfully, but these errors were encountered:
No branches or pull requests
规则里面写了
//所有消息都无法匹配时的fallback
webot.set(/.*/, function(info){
// 利用 error log 收集听不懂的消息,以利于接下来完善规则
// 你也可以将这些 message 存入数据库
log('unhandled message: %s', info.text);
info.flag = true;
return '你发送了「' + info.text + '」,可惜我太笨了,听不懂. 发送: help 查看可用的指令';
});
还是不能识别自定义的规则 比如
/ 可以通过回调返回结果
webot.set('search', {
description: '发送: s 关键词 ',
pattern: /^(?:搜索?|search|百度|s\b)\s*(.+)/i,
//handler也可以是异步的
handler: do_search
});
是什么原因呢?
Don't know what you are saying
The text was updated successfully, but these errors were encountered: