Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const { ConsoleBot } = require('bottender');
const handler = require('./handler');
const bot = new ConsoleBot();
bot.onEvent(handler);
module.exports = bot;
const { ConsoleBot, middleware } = require('bottender');
const bot = new ConsoleBot();
const handler1 = async (context, next) => {
await context.sendText('Hi there 1!');
await next();
await context.sendText('Hi there 3!');
};
const handler2 = async context => {
await context.sendText('Hi there 2!');
};
bot.onEvent(middleware([handler1, handler2]));
bot.createRuntime();
const { ConsoleBot } = require('bottender');
const bot = new ConsoleBot({ fallbackMethods: true });
bot.onEvent(async context => {
await context.sendText('Hello World');
});
bot.createRuntime();