I developed a Telegram bot with the python-telegram-bot
library and now i want to deploy it in my server, so i setup a webhook(following the Official Wiki) but when i try to communicate with my bot i don't get any reply.
This is the source of the bot:
def main():
PRIVTOKEN = "1134xxxx"
updater = Updater(PRIVTOKEN)
dp = updater.dispatcher
dp.add_handler(CommandHandler("start", start))
# ...
updater.start_webhook(listen='127.0.0.1',
port=8843,
url_path=PRIVTOKEN)
updater.bot.set_webhook(webhook_url='https://example.com/' + PRIVTOKEN,
certificate=open("cert.pem", "rb"))
print("bot started")
updater.idle()
the nginx config file:
server {
listen 443 ssl;
server_name example.com;
location /1134xxxx {
proxy_pass http://127.0.0.1:8443;
}
}
The netstat status:
sudo netstat -an | grep 8843
tcp 0 127.0.0.1:8843 0.0.0.0:* LISTEN
No other errors where logged either by the bot(i've enabled the error logs) or by nginx(access/error.log)
I’ve also added a custom rule for 8843 port in the firewall.