Skip to content

Commit

Permalink
Added confirmation to check if the !reply is to subscribers
Browse files Browse the repository at this point in the history
  • Loading branch information
Era Dorta committed Feb 28, 2022
1 parent 24a5c4a commit 9135ed1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions signalblast/bot_answers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 9135ed1

Please sign in to comment.