Closed painkkiller closed 11 months ago
I also tried to handle updates from webhook via this:
expressApp.post(URI, (req, res) => {
console.log('post', req.body);
/*
we need to respond back with 200 to let telegram know that we
have received the update. Failing to do so will result in telegram
not sending further updates after the first one.
*/
return bot.handleUpdate(req.body, res);
});
but looks method handleUpdate don't work nowdays, bot still can't react on commands
Both should work. Maybe you have an over-enthusiastic middleware that doesn't call next?
I've already found the culprit in my code. Thanks. Closing this ticket.
I am trying to make my first bot on base express framework. Example from here https://github.com/feathers-studio/telegraf-docs/blob/master/examples/webhook/express.ts not works. I am testing webhooks with ngrok, when I am making URI for webhook with express on my own I am getting calls from telegram and everything is OK. But I am unable to make bot work on commands, I suppose this line simply not works:
app.use(await bot.createWebhook({ domain: webhookDomain, path: URI }));
So I am unable to make my bot react on webhooks call from telegram