More than 1 user_id and update error
onurdemirhan opened this issue · comments
Hello,
I tried your code, It is amazing:) thanks.
But I have 2 issues which do not prevent the code work:
-
Is it possible to use more than 1 user_id in config.json ? I tried using this format
"user_id": {"123456789","987654321"}
but It gave "Expecting ':' delimiter:" error.
Is there a way to enter more than 1 telegram user_id -
I continuously get the following error in console
2018-05-07 23:28:00,461 - DEBUG - telegram.bot - Exiting: get_updates
2018-05-07 23:28:00,463 - DEBUG - telegram.bot - Entering: get_updates
2018-05-07 23:28:03,372 - DEBUG - telegram.vendor.ptb_urllib3.urllib3.connectionpool - https://api.telegram.org:443 "POST /bot123123sdfasdfasdf/getUpdates HTTP/1.1" 409 143
2018-05-07 23:28:03,377 - ERROR - telegram.ext.updater - Error while getting Updates: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running (409)
2018-05-07 23:28:03,379 - DEBUG - telegram.ext.dispatcher - Processing Update: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running (409)
2018-05-07 23:28:04,379 - DEBUG - telegram.bot - Entering: get_updates
2018-05-07 23:28:14,456 - DEBUG - telegram.vendor.ptb_urllib3.urllib3.connectionpool - https://api.telegram.org:443 "POST /bo123456asdfasdfasdfasd/getUpdates HTTP/1.1" 200 23
2018-05-07 23:28:14,460 - DEBUG - telegram.bot - No new updates found.
Is there a way to fix this?
Thank you
So for the first issue with multiple users:
That is possible to implement and there was actually already a pull request for that feature. But i have to say that i don't want that in the bot. For me it makes more sense to restrict it to one user. If you are interested to look into it yourself, see the pull request.
But there were so much changes since then, you will have to change quite a lot of stuff to get it working right now.
Second issue with make sure that only one bot instance is running
:
The reason for that is actually exactly what the message states :-) There is another instance of the bot running. Maybe you startet the bot but didn't quit it properly. So if you now start the bot again, Telegram will recognize that there is already a bot running and that's the reason for that error.
You have two possibilities how to resolve this:
-
Quit the previously running instance that is still running. You can do that by restarting the computer that you startet the bot on. Maybe you testet the bot locally and it is still running? Restart your computer. If you are running it on a server, restart that server.
-
If you can't find the running instance of the bot (you should be able to find it but if you really can't find it somehow) then create a new bot token in a conversation with
BotFather
at Telegram and set that new token in the config.
Then the old instance of the bot will still be running but agains the old token and you will not have any issues.
Hope that helps :-) Sorry that i will not implement the support for multiple users...
I will close this issue but if you still need something or something is not clear, let me know!