From b04dfeda4c88ba70ba5a33370df82b1d460945d8 Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Wed, 29 Nov 2023 18:24:41 +0300 Subject: [PATCH] allow force image send --- bots/modules/channel_helper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bots/modules/channel_helper.py b/bots/modules/channel_helper.py index e8fcd63..276487a 100644 --- a/bots/modules/channel_helper.py +++ b/bots/modules/channel_helper.py @@ -101,7 +101,10 @@ class ChannelHelperBotModuleConfig(TelegramBotModuleConfig): bot.get_file(p[-1]).download(out=io) im = Image.open(io) i.image_hash = imagehash.phash(im) - duplicate = self.queued_items.filter(image_hash=i.image_hash, type='photo').first() + if m.caption and 'force' in m.caption: + duplicate = None + else: + duplicate = self.queued_items.filter(image_hash=i.image_hash, type='photo').first() if duplicate: try: m = update.message.reply_photo(json.loads(duplicate.args)[0], f'Duplicate from {duplicate.datetime}', quote=True)