ehForwarderBot / efb-telegram-master

EFB Telegram Master Channel, a channel for EH Forwarder Bot.
GNU Affero General Public License v3.0
223 stars 78 forks source link

[BUG] Use own api_url,python-telegram-bot errors caused by parameter changes #119

Closed InPRTx closed 2 years ago

InPRTx commented 2 years ago

Describe the bug
python-telegram-bot forces a parameter in version v13.11 https://github.com/python-telegram-bot/python-telegram-bot/blob/a35ecf4065c74c773bd5871f7e70a9a3653ab543/telegram/files/sticker.py#L38

To Reproduce
Steps to reproduce the behavior:

  1. set flags api_base_url and api_base_file_url
  2. Send sticker
  3. terminal error

Expected behavior

2022-04-16 18:49:15,289 [ERROR]: telegram.ext.updater (updater._thread_wrapper; updater.py:356)
    unhandled exception in Bot:123456:updater
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/telegram/ext/updater.py", line 353, in _thread_wrapper
    target(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/telegram/ext/updater.py", line 622, in _start_polling
    self._network_loop_retry(
  File "/usr/local/lib/python3.9/dist-packages/telegram/ext/updater.py", line 646, in _network_loop_retry
    if not action_cb():
  File "/usr/local/lib/python3.9/dist-packages/telegram/ext/updater.py", line 597, in polling_action_cb
    updates = self.bot.get_updates(
  File "/usr/local/lib/python3.9/dist-packages/telegram/ext/extbot.py", line 224, in get_updates
    updates = super().get_updates(
  File "/usr/local/lib/python3.9/dist-packages/telegram/bot.py", line 130, in decorator
    result = func(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/telegram/bot.py", line 3067, in get_updates
    return Update.de_list(result, self)  # type: ignore[return-value]
  File "/usr/local/lib/python3.9/dist-packages/telegram/base.py", line 96, in de_list
    return [cls.de_json(d, bot) for d in data]
  File "/usr/local/lib/python3.9/dist-packages/telegram/base.py", line 96, in <listcomp>
    return [cls.de_json(d, bot) for d in data]
  File "/usr/local/lib/python3.9/dist-packages/telegram/update.py", line 399, in de_json
    data['message'] = Message.de_json(data.get('message'), bot)
  File "/usr/local/lib/python3.9/dist-packages/telegram/message.py", line 630, in de_json
    data['sticker'] = Sticker.de_json(data.get('sticker'), bot)
  File "/usr/local/lib/python3.9/dist-packages/telegram/files/sticker.py", line 147, in de_json
    return cls(bot=bot, **data)
TypeError: __init__() missing 1 required positional argument: 'is_video'

Version information (please complete the following information):

Version: 2.1.1
Python version:
3.9.7 (default, Sep 10 2021, 14:59:43)
[GCC 11.2.0]
Running on profile "default".

Master channel:
    Telegram Master (blueset.telegram) 2.2.5.dev3 # Default instance

Slave channel:
    QQ Slave (milkice.qq) 2.0.1 # Default instance

Middlewares:
    No middleware is enabled.

Additional context
Add any other context about the problem here.

blueset commented 2 years ago

Looking at the traceback, it looks like the issue is that the JSON received from the server did not contain the is_video field.

Are you using a custom bot server, e.g. tdlib/telegram-bot-api? If so, please ensure that you have updated the server program.