Bot middlewares
This package contains the base bot middlewares for building the bots.
Installation
npm install @kiina/bot-middlewares
Table of contents
AnswerMiddleware(logger?: Logger)
Picks up the given answer in the update
object and sends to the recipient.
Usage
const { AnswerMiddleware } = require('@kiina/bot-middlewares');
interface Logger {
info(...args): void;
error(...args): void;
}
const logger: Logger = /* ... */;
bot.addMiddleware(new AnswerMiddleware(logger));