Skip to content

TypeError 导致bot不工作 #10

Description

@PromethiumL

部署完成并赋予了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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions