javascript - 收到错误“TypeError:events.listenForEvents 不是函数”
问题描述
我在下面有这段代码,我收到错误“TypeError:events.listenForEvents 不是函数”。我的脚本可能有什么问题?谢谢你!
const { App, LogLevel } = require('@slack/bolt')
const clientOptions = {
// enable this for dev instance
// slackApiUrl: 'https://dev.slack.com/api/'
}
const port = process.env.PORT
// Log level is one of the options you can set in the constructor
const app = new App({
socketMode: true,
appToken: process.env.SLACK_APP_TOKEN,
clientOptions,
token: process.env.SLACK_BOT_TOKEN
// logLevel: LogLevel.DEBUG
})
const events = require('./events')
const interactions = require('./interactions')
events.listenForEvents(app)
interactions.listenForInteractions(app)
app.start(function () {
console.log(`Bot started`)
})```
解决方案
推荐阅读
- python - 了解 SHA 256
- python - 如何编写断言语句来测试 ValueError
- python - 我正在尝试查找位图图像的高度和宽度,我环顾了网络,但没有找到任何答案
- android - 如何使 Mapbox Marker 可点击并获取其属性?
- javascript - 如何从列表中创建对象
- laravel - Laravel Auth::User() 性能
- python - Selenium 在终端中有效,但在 Python Shell 中无效
- java - 依赖注入到嵌入式码头上的 websocket 端点
- jmeter - 如果我使用 ${status} == true 时控制器不工作
- flutter - 得到 NoSuchMethodError (NoSuchMethodError: The method 'call' was called on null. 在颤振中 setState 后出错