Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeletedMessagesHandler missing data. #116

Open
3 tasks done
JuiceFW opened this issue Nov 28, 2024 · 3 comments
Open
3 tasks done

DeletedMessagesHandler missing data. #116

JuiceFW opened this issue Nov 28, 2024 · 3 comments

Comments

@JuiceFW
Copy link

JuiceFW commented Nov 28, 2024

Checklist

  • I am sure the error is coming from Pyrogram's code and not elsewhere
  • I have searched in the issue tracker for similar bug reports, including closed ones
  • I ran pip3 install -U https://github.com/pyrogram/pyrogram/archive/master.zip and reproduced the issue using the latest development version

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

@JuiceFW JuiceFW changed the title DeletedMessagesHandler "question". DeletedMessagesHandler not enough data. Nov 28, 2024
@JuiceFW JuiceFW changed the title DeletedMessagesHandler not enough data. DeletedMessagesHandler missing data. Nov 28, 2024
@SpEcHiDe
Copy link
Contributor

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
Copy link
Contributor

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

SpEcHiDe added a commit that referenced this issue Nov 28, 2024
@JuiceFW
Copy link
Author

JuiceFW commented Nov 28, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants