usernein / pyromod

A monkeypatcher add-on for Pyrogram
https://pyromod.pauxis.dev/
GNU Lesser General Public License v3.0
223 stars 70 forks source link

Pyromod raising AttributeError: 'NoneType' object has no attribute 'id' #29

Closed Fima2003 closed 10 months ago

Fima2003 commented 1 year ago

I get this error, and from a little investigation it comes from waiting from messages from channels.

Traceback (most recent call last):
  File "/env/lib/python3.11/site-packages/pyrogram/dispatcher.py", line 226, in handler_worker
    if await handler.check(self.client, parsed_update):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/env/lib/python3.11/site-packages/pyromod/listen/listen.py", line 196, in check
    (message.chat.id, message.from_user.id, message.id),
                      ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'id'

What does it mean, and can you fix it?

WhaleFell commented 1 year ago

The pyromod needs to be modified Because pyromod listen does not determine if message.from_user.id exists or not.

usernein commented 10 months ago

Thanks for reporting!

Fixed in pyromod v3!