pyTelegramBotAPI icon indicating copy to clipboard operation
pyTelegramBotAPI copied to clipboard

I can't use multiple webhooks on the same machine

Open alfilesnet opened this issue 9 years ago • 4 comments

Please answer these questions before submitting your issue. Thanks!

  1. What version of pyTelegramBotAPI are you using? 3.0.1
  2. What OS are you using? Ubuntu 16.04 LTE
  3. What version of python are you using? 3.5.2

I have adapted the example of "webhook_aiohttp_echo_bot.py" to my bot and it works perfectly, but I have more than one bot.

I would like to know if there is any way to put several webhooks at the same time.

Thank you.

alfilesnet avatar Jun 28 '17 12:06 alfilesnet

Telegram Webhooks can be sent on ports 80, 8080, 8083 and 403. So you can have at least 4 bots on the same machine.
To have more bots, you need to set something in front of bots, I suggest nginx, which will act as a proxy for all bots' instantces. I've wrote an article some time ago about this, use Google Translate to undestand Russian language: https://groosha.gitbooks.io/telegram-bot-lessons/content/multiple_bots_2.html

MasterGroosha avatar Jun 30 '17 17:06 MasterGroosha

The port 88 is open on the router file3

The port 88 is not being used on the machine file2

192.168.0.137 is my local ip file4

And this is the error that gives me file1

Any idea?

alfilesnet avatar Jun 30 '17 23:06 alfilesnet

Using port <1024 requires superuser permissions

MasterGroosha avatar Jun 30 '17 23:06 MasterGroosha

@MasterGroosha I didn't know that ;) Now both work perfectly

Thanks

alfilesnet avatar Jun 30 '17 23:06 alfilesnet