Closed shahbaz4783 closed 3 months ago
You need to provide more info.
getWebhookInfo
?You need to provide more info.
- What is the output of
getWebhookInfo
?- Does your server receive the requests from Telegram?
- Does express receive the requests from Telegram?
- Does grammY receive the updates (but fails to call the right handlers)?
- Are there any errors?
- If you enable DEBUG mode, what is the output?
Output of webhookinfo
{
"ok": true,
"result": {
"url": "https://telegram-bot-seven-delta.vercel.app/api/bot",
"has_custom_certificate": false,
"pending_update_count": 6,
"last_error_date": 1723100098,
"last_error_message": "Wrong response from the webhook: 404 Not Found",
"max_connections": 40,
"ip_address": "76.76.21.61"
}
}
It works fine locally with ngrok
this is what i get when i start the server locally.
This tells you that there's a mismatch between the path that you used when calling setWebhook
and the path on which your server actually expects updates
This tells you that there's a mismatch between the path that you used when calling
setWebhook
and the path on which your server actually expects updates
how can i fix the mismatch.
for URL, im using vercel deployed url
https://telegram-bot-seven-delta.vercel.app
and for setting webhook, im adding /api/bot above url
i also tried this for URL
https://telegram-bot-seven-delta.vercel.app/api/bot
i get this when i open the link:
// Set up the webhook const secretPath = `/webhook/${bot.token}`; app.use(secretPath, webhookCallback(bot, 'express'));
You listen on /webhook/<token>
so that's what you have to append, not /api/bot
.
Yeah i figured out the issue, thanks for the help!
I deployed my telgram on vercel by following the guide on grammy. when i send /start to bot is isnt sending any response.
Here is the code of the bot
i also got success message from webhook