Closed Naktibalda closed 5 years ago
@Naktibalda can you fix some of the open issues along with this PR?
I converted code to Typescript.
Usage in Typescript:
import {WatsonMiddleware} from 'botkit-middleware-watson';
const watsonMiddleware = new WatsonMiddleware(config);
Usage in Javascript:
const WatsonMiddleware = require('../lib/middleware/index').WatsonMiddleware;
const middleware = new WatsonMiddleware(config);
Because this middleware is a class now, it must be registered this way: controller.middleware.receive.use(watsonMiddleware.receive.bind(watsonMiddleware));
(I wasted hours trying to figure out why controller.middleware.receive.use(watsonMiddleware.receive);
wasn't working.)
Botkit 4.0.1 was released yesterday, so Botkit 4 is complete.
@germanattanasio Please review, merge and release 2.0.0. Another option is to make it 4.0.0 to catchup with ibm-watson 4 and Botkit 4.
I updated README, but samples are still outdated.
@Naktibalda In order to merge this and trigger a major release we need to update or remove the multi-bot
sample. I vote for removing that sample and point users to botkit.
I agree on removal of multi-bot. I think that even the README of simple-bot should crearly state that "This is just a sample, please follow documentation of Botkit to create a new bot and then plug Watson middleware into it".
:exclamation: No coverage uploaded for pull request base (
master@3fc1bdc
). Click here to learn what that means. The diff coverage is78.5%
.
@@ Coverage Diff @@
## master #174 +/- ##
========================================
Coverage ? 78.5%
========================================
Files ? 2
Lines ? 107
Branches ? 22
========================================
Hits ? 84
Misses ? 19
Partials ? 4
Impacted Files | Coverage Δ | |
---|---|---|
lib/utils.js | 100% <100%> (ø) |
|
lib/index.js | 65.15% <65.15%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 3fc1bdc...74ab971. Read the comment docs.
Thanks
I updated javascript code to work with Botkit 4. It uses a different storage system now. Because Botkit uses promises everywhere now, I used Promises in utils.js too, but the interface of middleware remains unchanged.
BREAKING CHANGES: