From 7f0fec170f69687fc7b11e5ed370a4063919930b Mon Sep 17 00:00:00 2001 From: Phxntxm Date: Mon, 12 Dec 2016 09:52:04 -0600 Subject: [PATCH] Made sure that tags cannot be created that mention everyone --- cogs/tags.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cogs/tags.py b/cogs/tags.py index 31dd268..32e61e5 100644 --- a/cogs/tags.py +++ b/cogs/tags.py @@ -59,11 +59,16 @@ class Tags: await self.bot.say( "Please provide the format for the tag in: {}tag add - ".format(ctx.prefix)) return + # If our regex failed to find the content (aka they provided the wrong format) if len(tag) == 0 or len(tag_result) == 0: await self.bot.say( "Please provide the format for the tag in: {}tag add - ".format(ctx.prefix)) return + # Make sure the tag created does not mention everyone/here + if '@everyone' in tag_result or '@here' in tag_result: + await self.bot.say("You cannot create a tag that mentions everyone!") + return entry = {'server_id': ctx.message.server.id, 'tag': tag, 'result': tag_result} r_filter = lambda row: (row['server_id'] == ctx.message.server.id) & (row['tag'] == tag) # Try to create new entry first, if that fails (it already exists) then we update it