allow force image send

master
bakatrouble 3 months ago
parent 5bfc531b39
commit b04dfeda4c

@ -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)

Loading…
Cancel
Save