- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我目前正在与 slack-starter-chatbot
合作在 Slack 上创建聊天机器人。我正在使用 hears
处理函数。在文件夹 skill/sample_hears.js
中,我有以下代码。
module.exports = function(controller) {
controller.hears(['^hello$'], 'direct_message,direct_mention', function(bot, message) {
bot.reply(message, "Hi there, you're on workspace: " + message.team)
});
// listen for a message containing the world "food", and send a reply
controller.hears('^food$','message_received',function(bot, message) {
// do something!
bot.reply(message, 'What do you want to eat today?')
});
};
但是,当我在 Slack channel 上输入 food
或 hello
时,机器人不会回复。我知道 ngrok
端点是根据我从 Slack channel 获得的响应来工作的。 您好,您正在工作区:T674NXXXX
这是 ngrok
Session Status online
Session Expires 6 hours, 57 minutes
Version 2.2.8
Region United States (us)
Web Interface http://127.0.0.1:4040
Forwarding http://b6dXXXX.ngrok.io -> localhost:3000
Forwarding https://b6dXXXX.ngrok.io -> localhost:3000
Connections ttl opn rt1 rt5 p50 p90
0 0 0.00 0.00 0.00 0.00
可能是什么?
最佳答案
我认为发生这种情况是由于机器人正在监听的事件类型:['direct_message', 'direct_mention']
。如果您在消息中提及机器人,您应该会收到回复。
如果您希望机器人监听任何 channel 中的任何消息而不需要直接提及机器人,您应该监听 ambient
事件。
关于javascript - Botkit 的监听处理函数未在 Slack channel 上回复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51737280/
我遇到了一个奇怪的问题,我以前从未真正体验过这个,这是服务器的代码(在这种情况下客户端是 firefox),我创建它的方式: _Socket = new Socket( AddressFamily.I
我正在使用 C 编程语言在 Ubuntu 中开发原始套接字程序。由于我使用原始套接字,因此需要使用 SOCK_RAW 类型而不是 SOCK_STREAM。使用 SOCK_RAW 反过来会通过抛出 来禁
我实际上在客户端-客户端应用程序方面遇到了麻烦。这个问题中的一切都与Unix网络编程环境有关。 这是我的情况: 我有一个客户端(从现在起称为 C1),它调用 listen()在套接字上。 C1 输入
是否可以监听 QTcpSocket?我在 Tcp 上有一个简单的 p2p 连接。但是我找不到在随机自由端口上启动 QTcpSocket 的方法。我应该为此使用 QTcpServer,还是仅对 1 个连
我正在尝试根据 this documentation 监听码头更改事件和 ACTION_DOCK_EVENT . 我的接收器从未被击中。 我的代码看起来很简单,所以我想知道监听停靠事件是否需要权限?我
在 Linux 3.9 内核和更高版本中运行,我有一个应用程序 X,它在特定套接字上监听连接。我想写一个不相关的应用程序 Y,它跟踪尝试连接到此套接字的次数、源 IP 等。 是否可以在 c++ 中(最
是否可以监听日志条目?即是否存在用于附加日志条目的广播 Intent ? 最佳答案 没有 Intent 。 使用下面的代码: try { Process mLogcatProc
我已经实现了 installTap 方法,它为我提供了音频缓冲区浮点示例。我已经通过我的 C++ DSP 库过滤了它们。我想将此缓冲区“发送”到耳机/扬声器。我从示例中再次执行了 AVAudioPCM
我正在尝试启动一个在后台运行的服务,该服务正在监听 ACTION_SCREEN_OFF,当它找到 ACTION_SCREEN_OFF 时,启动我的 Activity 。 我在某处读到您需要创建一个Br
我正在开发一个 HOC,以帮助处理我的 React 应用程序中的表单(用于练习)。 // components/Wrapper.js import React from 'react'; export
我有“服务器端”mqtt 客户端,用于监视和管理远程 mqtt 客户端。我想扩展此服务器模块以密切关注远程客户端的连接。 在正常操作期间,远程客户端定期 PING 代理,根据代理日志: 1532924
我正在编写一个检查电池容量的守护进程。这是用于运行 Linux 的太阳能嵌入式设备。我读过使用 sleep() 是个坏主意在守护进程中,因此我正在尝试使用事件。所以我写了一些 PoC,但我没有收到任何
是否有一个库或技术来监听 Swing ui 对象上的所有可变事件?具体数据。 例如,我有一个带有 JTextArea、JCheckBox、JComboBox 等的 JPanel。有没有一种通用的方法可
使用 KineticJS,是否可以仅绑定(bind)函数一次?就像 jQuery 的等价物一样......例如。在 jQuery 中 // bad $('.wrap a').on('click', m
我正在使用 jquery 制作一个非常简单的富文本编辑器...我不想使用第三方的。 我需要监听 iframe(同一域等)内的事件,从输入开始。显然我需要经常使用bind()。 这就是我目前所拥有的,它
我有一个函数可以获取 XML 文档并根据 XSL 文档对其进行转换。然后,它将结果放入 id 为 laneconfigdisplay 的 div 中。我想要做的是,与转换逻辑分开,为该 div 设置一
如何检测 NSTextView 中的一行(即“\n”字符)被删除?我可以使用 textView:doCommandBySelector: 轻松监听新行并监听 "insertNewLine:"。 (参见
我有以下代码订阅 VisiblePosition 的属性更改事件Column 的属性(property)类(class): DependencyPropertyDescriptor dpd = Dep
我正在尝试在本地主机上收听浏览器的 DNS 请求。 我写了这段代码: WSADATA wsaData; unsigned char hostname[100]; int sockfd; struct
如何以 JSON 对象的形式接收对我网站上特定页面的回调?这些回调是从第三方 API 发出的,用于报告我与该 API 的通信状态。 我想过使用node.js的http.server.listen,但我
我是一名优秀的程序员,十分优秀!