I am using Telegraf library to work with Telegram API in Node.js and set up a webhook. Okay, now every request that was sent to the bot goes to the route. Now i can work with requests, register users, etc. using MVC structure. Ok, but so what? I could just did the same thing using Telegraf middleware like this.
bot.use(async (ctx, next) => {
// do anything you need here
await next()
})
What am i missing? I honestly don’t get it.
2
Answers
as it’s stated in the official documentation
The difference between them: