Open markschellhas opened 1 year ago
Bug Report
I have read:
I am using the latest version of the library.
Being able to receive messages/updates from Telegram bot.
Constant 302 redirect errors:
console extract:
error: [polling_error] {"code":"EPARSE","message":"EPARSE: Error parsing response: <html>\r\n<head><title>302 Found</title></head>\r\n<body>\r\n<center><h1>302 Found</h1></center>\r\n<hr><center>nginx/1.18.0</center>\r\n</body>\r\n</html>\r\n"} error: [polling_error] {"code":"EPARSE","message":"EPARSE: Error parsing response: <html>\r\n<head><title>302 Found</title></head>\r\n<body>\r\n<center><h1>302 Found</h1></center>\r\n<hr><center>nginx/1.18.0</center>\r\n</body>\r\n</html>\r\n"} error: [polling_error] {"code":"EPARSE","message":"EPARSE: Error parsing response: <html>\r\n<head><title>302 Found</title></head>\r\n<body>\r\n<center><h1>302 Found</h1></center>\r\n<hr><center>nginx/1.18.0</center>\r\n</body>\r\n</html>\r\n"} error: [polling_error] {"code":"EPARSE","message":"EPARSE: Error parsing response: <html>\r\n<head><title>302 Found</title></head>\r\n<body>\r\n<center><h1>302 Found</h1></center>\r\n<hr><center>nginx/1.18.0</center>\r\n</body>\r\n</html>\r\n"} error: [polling_error] {"code":"EPARSE","message":"EPARSE: Error parsing response: <html>\r\n<head><title>302 Found</title></head>\r\n<body>\r\n<center><h1>302 Found</h1></center>\r\n<hr><center>nginx/1.18.0</center>\r\n</body>\r\n</html>\r\n"} error: [polling_error] {"code":"EPARSE","message":"EPARSE: Error parsing response: <html>\r\n<head><title>302 Found</title></head>\r\n<body>\r\n<center><h1>302 Found</h1></center>\r\n<hr><center>nginx/1.18.0</center>\r\n</body>\r\n</html>\r\n"} error: [polling_error] {"code":"EPARSE","message":"EPARSE: Error parsing response: <html>\r\n<head><title>302 Found</title></head>\r\n<body>\r\n<center><h1>302 Found</h1></center>\r\n<hr><center>nginx/1.18.0</center>\r\n</body>\r\n</html>\r\n"} error: [polling_error] {"code":"EPARSE","message":"EPARSE: Error parsing response: <html>\r\n<head><title>302 Found</title></head>\r\n<body>\r\n<center><h1>302 Found</h1></center>\r\n<hr><center>nginx/1.18.0</center>\r\n</body>\r\n</html>\r\n"}
Using node version 20.2.0, running this code produces the error:
const TelegramBot = require('node-telegram-bot-api'); const bot = new TelegramBot(token, {polling: true}); bot.on('message', (msg:any) => { const chatId = msg.chat.id; console.log(msg); bot.sendMessage(chatId, 'Received your message'); });
I have checked that the token and chatId is indeed correct. I am able to make post requests successfully using fetch, only getting errors when using this library.
token
chatId
fetch
Any insight would be greatly appreciated!
Having the same issue here, any update on this @markschellhas ?
Same for me
I have read:
I am using the latest version of the library.
Expected Behavior
Being able to receive messages/updates from Telegram bot.
Actual Behavior
Constant 302 redirect errors:
console extract:
Steps to reproduce the Behavior
Using node version 20.2.0, running this code produces the error:
I have checked that the
token
andchatId
is indeed correct. I am able to make post requests successfully usingfetch
, only getting errors when using this library.Any insight would be greatly appreciated!