From bdfd452e064644a3415f0e8e1bcd785d698a0e33 Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Thu, 4 Aug 2022 16:57:01 +0300 Subject: [PATCH] update channel helper --- bots/modules/channel_helper.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bots/modules/channel_helper.py b/bots/modules/channel_helper.py index 0b4e719..d92f0f5 100644 --- a/bots/modules/channel_helper.py +++ b/bots/modules/channel_helper.py @@ -52,7 +52,7 @@ class ChannelHelperBotModuleConfig(TelegramBotModuleConfig): im.save(fpath) if self.queued: m = bot.send_photo(config.tmp_uploads_chat_id, open(fpath, 'rb')) - i = QueuedItem(config=self, type='photo', args=json.dumps([m.photo[-1].file_id])) + i = QueuedItem(config=self, type='photo', args=json.dumps([m.photo[-1].file_id]), message_id=m.message_id) i.save() else: bot.send_photo(self.chat_id, open(fpath, 'rb')) @@ -129,8 +129,9 @@ class ChannelHelperBotModuleConfig(TelegramBotModuleConfig): try: msg = QueuedItem.objects.get(message_id=reply_to_id, config=self) msg.delete() - except QueuedItem.DoesNotExist: update.effective_message.reply_text('Deleted') + except QueuedItem.DoesNotExist: + update.effective_message.reply_text('Not found') def handle_count(self, update: Update, ctx: CallbackContext): if self.users.count() and not self.users.filter(user_id=update.effective_user.id).count():