Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.

Fix AttributeError in ChatType filters - #1391

Closed
Gustavosta wants to merge 3 commits into
pyrogram:masterfrom
Gustavosta:master
Closed

Fix AttributeError in ChatType filters#1391
Gustavosta wants to merge 3 commits into
pyrogram:masterfrom
Gustavosta:master

Conversation

@Gustavosta

@Gustavosta Gustavosta commented Feb 4, 2024

Copy link
Copy Markdown

Fixed a bug caused by: AttributeError: 'CallbackQuery' object has no attribute 'chat', also related to Issue #1273

Full TraceBack:

CallbackQuery' object has no attribute 'chat'
Traceback (most recent call last):
  File "C:\Users\Gustavo\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyrogram\dispatcher.py", line 226, in handler_worker
    if await handler.check(self.client, parsed_update):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    return await self.filters(client, update)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Gustavo\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyrogram\filters.py", line 79, in __call__
    y = await self.other(client, update)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Gustavo\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyrogram\filters.py", line 443, in private_filter
    return bool(m.chat and m.chat.type in {enums.ChatType.PRIVATE, enums.ChatType.BOT})
                ^^^^^^
AttributeError: 'CallbackQuery' object has no attribute 'chat'

@Gustavosta Gustavosta closed this by deleting the head repository Feb 17, 2024
SpEcHiDe referenced this pull request in TelegramPlayground/PyroTGFork Apr 20, 2024
SpEcHiDe pushed a commit to TelegramPlayground/PyroTGFork that referenced this pull request Sep 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant