TelegramPlayGround / pyrogram

PyroGramFORK | Telegram MTProto API framework in Python for users and bots | PyroGramFORK
https://telegramplayground.github.io/pyrogram/
GNU Lesser General Public License v3.0
87 stars 14 forks source link

AttributeError: 'NoneType' object has no attribute 'is_bot' #102

Closed Cosangeles55 closed 2 weeks ago

Cosangeles55 commented 2 weeks ago

Checklist

Description

The error just appears when working with accounts; I can't pinpoint the exact place, but in my code, I switched to getattr(user_obj, 'is_bot', False) instead of user_obj.is_bot

Steps to reproduce

-

Code example

-

Logs

backend_fastapi  | Traceback (most recent call last):
backend_fastapi  |   File "/usr/local/lib/python3.10/site-packages/pyrogram/dispatcher.py", line 302, in handler_worker
backend_fastapi  |     await parser(update, users, chats)
backend_fastapi  |   File "/usr/local/lib/python3.10/site-packages/pyrogram/dispatcher.py", line 101, in message_parser
backend_fastapi  |     await pyrogram.types.Message._parse(
backend_fastapi  |   File "/usr/local/lib/python3.10/site-packages/pyrogram/types/messages_and_media/message.py", line 1225, in _parse
backend_fastapi  |     story = await types.Story._parse(client, users, chats, media, None, None, None, None)
backend_fastapi  |   File "/usr/local/lib/python3.10/site-packages/pyrogram/types/messages_and_media/story.py", line 260, in _parse
backend_fastapi  |     if story_id and not client.me.is_bot:
backend_fastapi  | AttributeError: 'NoneType' object has no attribute 'is_bot'
SpEcHiDe commented 2 weeks ago

Do you use the pyrogram.Client without starting it first?

Can you show the code where you start / stop the pyrogram.Client ?