Search code examples
pythontelegrampyrogram

Why doesn't pyrogram see the chat description?


pyrogram doesn't see the chat description

I write to my chat with a description and

@app.on_message()
async def handler(_, msg: types.Message):
    print(msg.chat.bio)
    print(msg.chat.description)

this /\ outputs this \/

None
None

Solution

  • The Chat object within the Message object doesn't have the description. You have to explicitly call app.get_chat() to get the Chat.bio or Chat.description.

    bio (str, optional) – Bio of the other party in a private chat. Returned only in get_chat().

    description (str, optional) – Description, for groups, supergroups and channel chats. Returned only in get_chat().

    https://docs.pyrogram.org/api/types/Chat