Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

controller.spawn("yourTeamId") breaks on v4.8.0 for Slack #1937

Closed
GaryTowers opened this issue Mar 18, 2020 · 4 comments · Fixed by #1938
Closed

controller.spawn("yourTeamId") breaks on v4.8.0 for Slack #1937

GaryTowers opened this issue Mar 18, 2020 · 4 comments · Fixed by #1938
Assignees
Labels

Comments

@GaryTowers
Copy link
Contributor

What are you trying to achieve?

I'm trying to spawn a bot by just passing the team ID of a slack team that uses my bot to start a conversation with a user over Slack (as stated in the documentation)

// botInstalled.js file

const teamId = 'validSlackTeamId'
const userId = 'validSlackUserId'

const bot = await controller.spawn(teamId); // <-- Errors out here

await bot.startPrivateConversation(userId);
await bot.say('Hi!');

What was the result you received?

TypeError: Cannot read property 'adapter' of undefined

TypeError: Cannot read property 'adapter' of undefined\n
at Botkit.<anonymous> (node_modules/botkit/lib/core.js:807:62)\n
at Generator.next (<anonymous>)\n 
at node_modules/botkit/lib/core.js:8:71\n
at new Promise (<anonymous>)\n
at __awaiter (node_modules/botkit/lib/core.js:4:12)\n
at Botkit.spawn (/node_modules/botkit/lib/core.js:789:16)\n
at Object.<anonymous> (myProject/slack/on/botInstalled.js:47:42)"

I've traced the error to this line inside the core library
https://github.com/howdyai/botkit/blob/master/packages/botkit/src/core.ts#L1080

What did you expect?

For the controller to spawn a bot without issues just by passing the slack team Id as stated in the documentation.

Previous to this error I was using botkit v4.6.2 and I had no issue with this. Most likely a change in the latest version broke the functionality of just passing the TeamID (or I'm def doing something wrong) 😅please let me know, and thanks for looking into this 🎉

Context:

  • Botkit version: 4.8.0
  • Messaging Platform: Slack (adater v 1.0.9)
  • Node version: v13.7.0
  • Os: MacOS Mojave 10.14.6
  • Any other relevant information:
@sfny
Copy link
Contributor

sfny commented Mar 18, 2020

I'm seeing this too. Perhaps it's something in the new multi-adapter support ( #1920 ) in v4.8. If so it is probably not specific to slack.

@benbrown
Copy link
Contributor

Shoot! I know what this is. I will issue a patch ASAP!!

@sfny
Copy link
Contributor

sfny commented Mar 18, 2020

Updating botkit to 4.8.1 and botbuilder-adapter-slack to 1.0.10 resolved this issue.

@GaryTowers
Copy link
Contributor Author

Thanks for the quick fix!

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

Successfully merging a pull request may close this issue.

3 participants