calculate image hash for images sent in chat
This commit is contained in:
@@ -98,7 +98,8 @@ class ChannelHelperBotModuleConfig(TelegramBotModuleConfig):
|
||||
io.name = 'file.jpg'
|
||||
bot.get_file(p[-1]).download(out=io)
|
||||
im = Image.open(io)
|
||||
if self.queued_items.filter(image_hash=imagehash.phash(im), type='photo').count() > 0:
|
||||
i.image_hash = imagehash.phash(im)
|
||||
if self.queued_items.filter(image_hash=i.image_hash, type='photo').count() > 0:
|
||||
return
|
||||
elif hasattr(m, 'sticker') and m.sticker:
|
||||
s = m.sticker
|
||||
|
Reference in New Issue
Block a user