From 50ff89d606c31ac42703d0e1b2a1714479ad84cb Mon Sep 17 00:00:00 2001 From: aahnik Date: Wed, 2 Jun 2021 12:27:49 +0530 Subject: [PATCH] fix #53 --- tgcf/past.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tgcf/past.py b/tgcf/past.py index cb69483f..89a4c9f0 100644 --- a/tgcf/past.py +++ b/tgcf/past.py @@ -26,6 +26,8 @@ async def forward_job() -> None: async for message in client.iter_messages( forward.source, reverse=True, offset_id=forward.offset ): + if forward.end and last_id > forward.end: + continue if isinstance(message, MessageService): continue try: @@ -36,7 +38,7 @@ async def forward_job() -> None: for destination in forward.dest: await send_message(destination, tm) tm.clear() - last_id = str(message.id) + last_id = message.id logging.info(f"forwarding message with id = {last_id}") forward.offset = last_id write_config(CONFIG)