anote
1import { Telegraf, session, Context } from 'telegraf';
2import Processor from './flows/Processor';
3import { BotContext } from './types/Types';
4
5const config = require('config');
6const bot = new Telegraf<BotContext>(config.get("token"));
7const processor: Processor = new Processor();
8
9bot.use(session());
10
11bot.start((ctx) => ctx.reply('Welcome to NoteBote!'))
12
13bot.on('text', (ctx: Context) => {
14processor.text(ctx);
15});
16
17bot.launch();
18
19// module.exports.handler = async function (event: { body: string; }, context: any) {
20// const message = JSON.parse(event.body);
21// await bot.handleUpdate(message);
22// return {
23// statusCode: 200,
24// body: '',
25// };
26// };