Skip to content
New issue

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

Issue with oauth add to team not writing teams.bot part #8

Open
alecl opened this issue Jan 20, 2017 · 2 comments
Open

Issue with oauth add to team not writing teams.bot part #8

alecl opened this issue Jan 20, 2017 · 2 comments

Comments

@alecl
Copy link

alecl commented Jan 20, 2017

Because the teams.bot field is not in place this code fails when the bot tries to process a mention right here:

https://github.com/howdyai/botkit/blob/v0.4.9/lib/SlackBot.js#L177

[2017-01-20T03:39:52Z]TypeError: Cannot read property 'user_id' of undefined
[2017-01-20T03:39:52Z] at /usr/src/app/node_modules/botkit/lib/SlackBot.js:177:33
[2017-01-20T03:39:52Z] at Command.callback (/usr/src/app/node_modules/botkit-storage-redis/src/index.js:41:17)
[2017-01-20T03:39:52Z] at normal_reply (/usr/src/app/node_modules/botkit-storage-redis/node_modules/redis/index.js:721:21)
[2017-01-20T03:39:52Z] at RedisClient.return_reply (/usr/src/app/node_modules/botkit-storage-redis/node_modules/redis/index.js:819:9)
[2017-01-20T03:39:52Z] at JavascriptRedisParser.Parser.returnReply (/usr/src/app/node_modules/botkit-storage-redis/node_modules/redis/index.js:192:18)
[2017-01-20T03:39:52Z] at JavascriptRedisParser.execute (/usr/src/app/node_modules/botkit-storage-redis/node_modules/redis/node_modules/redis-parser/lib/parser.js:491:12)
[2017-01-20T03:39:52Z] at Socket.<anonymous> (/usr/src/app/node_modules/botkit-storage-redis/node_modules/redis/index.js:274:27)
[2017-01-20T03:39:52Z] at emitOne (events.js:77:13)
[2017-01-20T03:39:52Z] at Socket.emit (events.js:169:7)
[2017-01-20T03:39:52Z] at readableAddChunk (_stream_readable.js:146:16)
[2017-01-20T03:39:52Z] at Socket.Readable.push (_stream_readable.js:110:10)
[2017-01-20T03:39:52Z] at TCP.onread (net.js:523:20)

I'm basically running off of the https://github.com/howdyai/botkit-starter-slack with some conversational and other code added but nothing messing with the core bot experience other than the piece below that runs through beepboop-botkit RTM instead of botkit Events API when running under BeepBoop.

if (process.env.BEEPBOOP) {
logger.info('Starting in Beep Boop multi-team mode');
require('beepboop-botkit').start(controller, { debug: true });
} else {
controller.startTicking();
}

Slack settings of note

OAuth:
https://beepboophq.com/proxy/:myid/oauth
https://beepboophq.com/api/slack/auth/add-to-slack

Note, I had to add the second url for direct as apparently "Add to Slack" stops there first before going to the proxy? Was an unexpected surprise.

Event Subscriptions, Interactive Messages, Slash Commands URL

https://beepboophq.com/proxy/:myid/slack/receive

@alecl
Copy link
Author

alecl commented Jan 20, 2017

For the plain botkit side for standalone testing I'm using the Slack Events API and ngrok to tunnel to local machine and followed the instructions here and all worked fine with the same code.

I'm using https://github.com/howdyai/botkit-storage-redis and a server on RedisLabs.

@alecl
Copy link
Author

alecl commented Jan 20, 2017

Forgot to mention exception happens on typing something like "Say hi" which loads info from storage. Typing plain "Hi" works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant