超时是到达松弛机器人

时间:2018-12-10 17:02:31

标签: node.js slack-api botkit

我已经遵循了botkit的官方松弛文档,但是当我尝试执行命令时,我得到了 Darn - that slash command didn't work (error message: `500_service_error`). Manage the command at test-slash,我无法获得良好的结果 每当我去mytunnel.localtunnel.me/oauth进行授权时,就会发生这种情况。

    ...
    notice: RTM websocket opened
    info: ** API CALL: https://slack.com/api/oauth.access
    info: ** API CALL: https://slack.com/api/auth.test
    info: Warning: using temporary storage. Data will be lost when process restarts.
    info: Warning: using temporary storage. Data will be lost when process restarts.
TypeError: Cannot read property 'user_id' of undefined

我的配置

var slackConfig = {
  clientId: CLIENT_ID,
  clientSecret: CLIENT_SECRET,
  redirectUri: 'mytunnel.localtunnel.me/oauth',
  scopes: ['commands'],
}

var controller = Botkit.slackbot({
  debug: false,
  clientSigningSecret: SIGN_SECRET,
}).configureSlackApp(slackConfig);


controller.setupWebserver(8080, function (err, webserver) {
    if (err) { console.log(err) }
    controller.createWebhookEndpoints(controller.webserver);
    controller.createOauthEndpoints(controller.webserver, function (err, req, res) {
        if (err) {
            res.status(500).send('ERROR: ' + err);
        } else {
            res.send('Success!');
        }
    });
});


var bot = controller.spawn({
  token: SLACKTOKEN,
}).startRTM()

0 个答案:

没有答案
相关问题