Skip to content

None type check #1

@zawsq

Description

@zawsq

Ensure channel has id attribute:

return message.chat.id in DatabaseCache.channels

Logs:

^^^^^^^^^^^^                                                
                      File                                                      
                    "/usr/local/lib/python3.11/site-packages/p                  
                    yrogram/handlers/deleted_messages_handler.                  
                    py", line 58, in check                                      
                        if await super().check(client,                          
                    message):                                                   
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                  
                    ^                                                           
                      File                                                      
                    "/usr/local/lib/python3.11/site-packages/p                  
                    yrogram/handlers/handler.py", line 35, in                   
                    check                                                       
                        return await self.filters(client,                       
                    update)                                                     
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                  
                    ^^^                                                         
                      File                                                      
                    "/bot/Logram/bot/helpers/pyrofilters/chann                  
                    el_in_db.py", line 14, in func                              
                        return message.chat.id in                               
                    DatabaseCache.channels                                      
                               ^^^^^^^^^^^^^^^                                  
                    AttributeError: 'NoneType' object has no                    
                    attribute 'id'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions