From 9a7c0637e29118b082f7469f7c2fb73d8365a468 Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Sat, 26 Jul 2025 02:44:37 +0300 Subject: [PATCH] change rpc return format --- bots/modules/channel_helper.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bots/modules/channel_helper.py b/bots/modules/channel_helper.py index 01e4fff..c1dd77f 100644 --- a/bots/modules/channel_helper.py +++ b/bots/modules/channel_helper.py @@ -57,7 +57,10 @@ class ChannelHelperBotModuleConfig(TelegramBotModuleConfig): image_hash = imagehash.phash(im) if self.queued_items.filter(image_hash=str(image_hash), type='photo').count() > 0: - return 'duplicate' + return { + 'status': 'duplicate', + 'hash': str(image_hash), + } width, height = im.size if width > 2000 or height > 2000: @@ -72,7 +75,10 @@ class ChannelHelperBotModuleConfig(TelegramBotModuleConfig): # else: # bot.send_photo(self.chat_id, open(fpath, 'rb')) # QueuedItem.objects.create(config=self, type='photo', args=json.dumps([]), image_hash=image_hash, processed=True) - return str(image_hash) + return { + 'status': 'ok', + 'hash': str(image_hash), + } def rpc_post_gif(self, url, note=''): config._reload_maybe()