pyTelegramBotAPI icon indicating copy to clipboard operation
pyTelegramBotAPI copied to clipboard

Another bot instance —> 409, unsuccessful request

Open rudskoy opened this issue 9 years ago • 1 comments

Bot is working under zoo keeper on some amount of servers. For testing I want to launch it locally without stopping the production version of the bot.

Getting the error: `2017-02-23 19:38:49,513 (root) INFO: Start 2017-02-23 19:38:49,519 (requests.packages.urllib3.connectionpool) INFO: Starting new HTTPS connection (1): api.telegram.org Traceback (most recent call last): <some_traceback>

self.telegram_client.process_new_updates(self.telegram_client.get_updates(offset=self.telegram_client.last_update_id + 1)) File "contrib/python/pytelegrambotapi/telebot/init.py", line 106, in get_updates json_updates = apihelper.get_updates(self.token, offset, limit, timeout, allowed_updates) File "contrib/python/pytelegrambotapi/telebot/apihelper.py", line 162, in get_updates return _make_request(token, method_url, params=payload) File "contrib/python/pytelegrambotapi/telebot/apihelper.py", line 43, in _make_request return _check_result(method_name, result)['result'] File "contrib/python/pytelegrambotapi/telebot/apihelper.py", line 62, in _check_result raise ApiException(msg, method_name, result) ApiException: A request to the Telegram API was unsuccessful. The server returned HTTP 409 Conflict. Response body: [{"ok":false,"error_code":409,"description":"Conflict: terminated by other long poll or webhook"}]`

API ver. is downloaded two weeks ago (~10.02 feb) macOS 2.7.13

rudskoy avatar Feb 23 '17 17:02 rudskoy

You cannot run two instantces of the same bot simultaneously. Create another one, keep the code intact and just change the token on "test instance".

MasterGroosha avatar Feb 28 '17 20:02 MasterGroosha