update channel helper

This commit is contained in:
bakatrouble 2022-08-04 16:57:01 +03:00
parent 21b465a3b1
commit bdfd452e06

View File

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