Telethon and messages not received from some channels

Viewed 355

I have a software which monitors multiple telegram channels and performs actions based on the received messages. The problem is that in the past month it stopped received messages from some of the channels.

I'm using one of the examples in the official repositories with some additions.

@callback
async def check_chat(self, event=None):
    """
    Checks the input chat where to send and listen messages from.
    """
    if self.me is None:
        return  # Not logged in yet

    chat = self.chat.get().strip()
    try:
        chat = int(chat)
    except ValueError:
        pass
      
        
async def on_msg_received(self, event): 
    global folders_list
    
    now = datetime.now()
    hour = now.hour
    minute = now.minute
                
    nome_chat = ''
    try:
        async for dialog in self.cl.iter_dialogs():
            if(dialog.id == event.chat_id):
                nome_chat = dialog.name
    except:
        logging.warning('error at on_msg_received')

    logging.warning('------- chat = %s', nome_chat)
    testo = event.raw_text

With some chats I don't get any activity at all, I expect to get either an error or the chat name. What could be the issue here? Does it make any difference if the channel is sending messages from telegram web or desktop?

0 Answers
Related