From 9c2928fa4eb677a3b164f504ba98d08ccb63be33 Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Sat, 2 Apr 2022 12:42:36 +0300 Subject: [PATCH] fix channel helper commands --- bots/modules/channel_helper.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bots/modules/channel_helper.py b/bots/modules/channel_helper.py index 65c586c..0b4e719 100644 --- a/bots/modules/channel_helper.py +++ b/bots/modules/channel_helper.py @@ -122,7 +122,8 @@ class ChannelHelperBotModuleConfig(TelegramBotModuleConfig): i.send(bot) def handle_delete(self, update: Update, ctx: CallbackContext): - if update.effective_message.chat_id != self.chat_id: + if self.users.count() and not self.users.filter(user_id=update.effective_user.id).count(): + update.effective_message.reply_text('GTFO') return reply_to_id = update.effective_message.reply_to_message.message_id try: @@ -132,7 +133,8 @@ class ChannelHelperBotModuleConfig(TelegramBotModuleConfig): update.effective_message.reply_text('Deleted') def handle_count(self, update: Update, ctx: CallbackContext): - if update.effective_message.chat_id != self.chat_id: + if self.users.count() and not self.users.filter(user_id=update.effective_user.id).count(): + update.effective_message.reply_text('GTFO') return update.effective_message.reply_text(f'{QueuedItem.objects.filter(config=self).count()} items queued')