aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Daniel Brown <[email protected]>2018-10-29 13:39:15 -0500
committerGravatar Daniel Brown <[email protected]>2018-10-29 13:39:15 -0500
commit8aa586bba43fbcfdf2633065c83f5f5123113776 (patch)
treea015b3be2e8bcdfab57039f4b31da016c82ecaaa
parentMerge branch 'aliascog' into 'master' (diff)
Correcting a logic error in the edited message deletion thingy.
Also cleaned up the has_bad_ticks() function a bit. Signed-off-by: Daniel Brown <[email protected]>
-rw-r--r--bot/cogs/bot.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/bot/cogs/bot.py b/bot/cogs/bot.py
index 168916a64..846783e08 100644
--- a/bot/cogs/bot.py
+++ b/bot/cogs/bot.py
@@ -236,8 +236,7 @@ class Bot:
"\u3003\u3003\u3003"
]
- has_bad_ticks = msg.content[:3] in not_backticks
- return has_bad_ticks
+ return msg.content[:3] in not_backticks
async def on_message(self, msg: Message):
"""
@@ -372,11 +371,11 @@ class Bot:
channel = self.bot.get_channel(payload.data.get("channel_id"))
user_message = await channel.get_message(payload.message_id)
- # Checks to see if the user has corrected their codeblock
+ # Checks to see if the user has corrected their codeblock. If it's fixed, has_fixed_codeblock will be None
has_fixed_codeblock = self.codeblock_stripping(payload.data.get("content"), self.has_bad_ticks(user_message))
# If the message is fixed, delete the bot message and the entry from the id dictionary
- if has_fixed_codeblock:
+ if has_fixed_codeblock is None:
bot_message = await channel.get_message(self.codeblock_message_ids[payload.message_id])
await bot_message.delete()
del self.codeblock_message_ids[payload.message_id]