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
97 stars 15 forks source link

DeletedMessagesHandler missing data. #116

Open JuiceFW opened 2 days ago

JuiceFW commented 2 days ago

Checklist

Description

Hi! I ran into a little problem with the deleted message handler. I'm using the decorator @on_deleted_messages(), and it worked fine before that.

Since some time ago, he stopped receiving complete data. He gets a list of messages, but the message looks like this: { "_": "Message", "id": 150413 }

And this is definitely not enough to work with data. I need at least the chat ID, but it's gone somewhere.

I would like to make sure that I can't do anything on my part. I didn't find any information in the documentation, and neither did the posts.

Steps to reproduce

  1. Checked internet
  2. Checked documentation

Code example

from pyrogram import Client, types

session_name = ""
api_hash = ""
api_id = 0

app = Client(session_name, api_hash=api_hash, api_id=api_id)

@app.on_deleted_messages()
async def delete_handler(client, messages: list[types.Message]):
    print(f"[INFO] New deleted messages...")

    for message in messages:
        if not message.chat:
            print(f"[WARNING] No chat: {message}...")
            continue

    print("all fine")

app.run()

Logs

No response

SpEcHiDe commented 2 days ago

You did not read the documentation of this fork

2024-11-28_21-27

but yes, there is no high level method yet to get_message only from a message_id.

SpEcHiDe commented 2 days ago

Most probably the regression was introduced somewhere around this commit: c47a2fa

JuiceFW commented 2 days ago

Oh, yes, thank you. So, if a message is received from a dialog, is the message ID unique? Just trying to get the information from the image above