Amazebot / bbot

An adaptable conversation engine for building bespoke bots.
MIT License
55 stars 2 forks source link

Middleware `IPieceDone` shouldn't require async #64

Closed timkinnane closed 6 years ago

timkinnane commented 6 years ago

The executePiece could wrap calling done() in a Promise.resolve, allowing IPieceDone interface to accept functions resolving with Promise<void>|void.

Then update tests that use () => Promise.resolve() to just () => null.

see https://github.com/Amazebot/bbot/blob/master/src/adapters/mongo.ts#L120