diff --git a/telemirror/mirroring.py b/telemirror/mirroring.py index a37d26b..4183ac6 100644 --- a/telemirror/mirroring.py +++ b/telemirror/mirroring.py @@ -85,12 +85,15 @@ async def new_message( for outgoing_chat, configs in outgoing_chats.items(): for config in configs: - if config.from_topic_id is not None: + # Check for incoming topic id, general topic has id = 1 + if config.from_topic_id is not None and config.from_topic_id != 1: if message.reply_to is None: continue + # Message in the topic if message.reply_to.reply_to_top_id is not None: if message.reply_to.reply_to_top_id != config.from_topic_id: continue + # Reply in the topic else: if message.reply_to.reply_to_msg_id != config.from_topic_id: continue @@ -192,15 +195,18 @@ async def new_album( for outgoing_chat, configs in outgoing_chats.items(): for config in configs: - if config.from_topic_id is not None: + # Check for incoming topic id, general topic has id = 1 + if config.from_topic_id is not None and config.from_topic_id != 1: if incoming_first_message.reply_to is None: continue + # Message in the topic if incoming_first_message.reply_to.reply_to_top_id is not None: if ( incoming_first_message.reply_to.reply_to_top_id != config.from_topic_id ): continue + # Reply in the topic else: if ( incoming_first_message.reply_to.reply_to_msg_id