From 9135ed1e94efab5ca2344053feeb29662202defc Mon Sep 17 00:00:00 2001 From: Era Dorta Date: Mon, 28 Feb 2022 23:18:53 +0100 Subject: [PATCH] Added confirmation to check if the !reply is to subscribers --- signalblast/bot_answers.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/signalblast/bot_answers.py b/signalblast/bot_answers.py index 57d90c5..fe5ada4 100644 --- a/signalblast/bot_answers.py +++ b/signalblast/bot_answers.py @@ -324,6 +324,17 @@ async def msg_from_admin(self, ctx: ChatContext) -> None: return user_id, message = message.split(' ', 1) + + if user_id not in self.subscribers: + if ' ' in message: + confirmation, message = message.split(' ', 1) + else: + confirmation = None + if confirmation != '!force': + warn_message = "User is not in subscribers list, use !reply !force to message them" + await self.reply_with_warn_on_failure(ctx, warn_message) + return + message = 'Admin: ' + message attachments = self.message_handler.prepare_attachments(ctx.message.data_message.attachments)