Telegram-CAPTCHA-bot icon indicating copy to clipboard operation
Telegram-CAPTCHA-bot copied to clipboard

TypeError 导致bot不工作

Open PromethiumL opened this issue 5 years ago • 0 comments

部署完成并赋予了bot管理员权限后,当新用户通过invatation link进入group的时候bot不响应,此时python控制台输出的错误是

Traceback (most recent call last):
  File "/home/x/apps/Telegram-CAPTCHA-bot/venv/lib/python3.7/site-packages/telethon/client/updates.py", line 422, in _dispatch_update
    await callback(event)
  File "main.py", line 72, in challenge_user
    member = await bot(GetParticipantRequest(chat, target))
  File "/home/x/apps/Telegram-CAPTCHA-bot/venv/lib/python3.7/site-packages/telethon/client/users.py", line 34, in __call__
    await r.resolve(self, utils)
  File "/home/x/apps/Telegram-CAPTCHA-bot/venv/lib/python3.7/site-packages/telethon/tl/functions/channels.py", line 806, in resolve
    self.channel = utils.get_input_channel(await client.get_input_entity(self.channel))
  File "/home/x/apps/Telegram-CAPTCHA-bot/venv/lib/python3.7/site-packages/telethon/utils.py", line 248, in get_input_channel
    _raise_cast_fail(entity, 'InputChannel')
  File "/home/x/apps/Telegram-CAPTCHA-bot/venv/lib/python3.7/site-packages/telethon/utils.py", line 133, in _raise_cast_fail
    type(entity).__name__, target))
TypeError: Cannot cast InputPeerChat to any kind of InputChannel.

PromethiumL avatar Jun 03 '20 18:06 PromethiumL