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

[WIP][CCP-194] Update Botkit #49

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

MissaDavid
Copy link
Contributor

@MissaDavid MissaDavid commented Nov 4, 2019

This PR is about updating botkit to the latest version. (JIRA ticket).

Botkit4 has a different structure, so this is what has been done in this PR:

  • Added the required package for the desired adapter (for this project it is botbuilder-adapter-slack)
  • Added options to this adapter --> we are configuring slack for multi-teams, so there are a lot of parameters to add. See here for details, but don't forget that because we use ngrok, the REDIRECT_URI environment variable has to be updated each time you close the connection. (And add this variable to .env if you don't have it, it is a required param).
  • Instantiate this adapter class with the created options.
  • Instantiate the Botkit core class controller with the adapter, in addition to an internal memory storage (see below in DB paragraph for details).

To see if your bot is installed properly:

  • npm run dev as usual
  • ngrok http 3000 (no changes here)
    Then go to the install endpoint http://localhost:3000/install and you should see your slack app requesting authorisation to continue. If you agree it should redirect you to the REDIRECT_URI, and you will see the message : Success! Bot installed.

At the moment we are only storing a few oauth tokens in the internal storage. But the next thing to solve is the DB storage for skills and users. As said in the docs: In v4 of Botkit, the storage system is currently only used to store and retrieve the conversation state between turns. Other than this, Botkit will no longer be providing an interface for connecting to or using databases. Developers should build their own database abstractions.

P.S: instead of server.js we are using botController.webserver: it looks like it is recommended to use this express server, which is shipped with the controller.

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

Successfully merging this pull request may close these issues.

1 participant