diff options
| author | 2018-09-13 10:39:17 -0500 | |
|---|---|---|
| committer | 2018-09-13 10:39:17 -0500 | |
| commit | 5106168704020679e3261e5687f118726dbc09ad (patch) | |
| tree | a3f2d528dfae0f7f47d8597683603f6bc99ac617 | |
| parent | Merge remote-tracking branch 'origin/hemlock-format_block_timeout' into hemlo... (diff) | |
- Changed variable name from bad_ticks to has_bad_ticks
- Added x emoji to the constants file and changed the add_reaction to use the Emoji object instead of the emoji icon
- Adjusted variable names to be more informative
- Added comments to better explain how on_reaction_add functions
Signed-off-by: Daniel Brown <[email protected]>
| -rw-r--r-- | bot/cogs/bot.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bot/cogs/bot.py b/bot/cogs/bot.py index 3b1c83840..12647bb05 100644 --- a/bot/cogs/bot.py +++ b/bot/cogs/bot.py @@ -229,7 +229,7 @@ class Bot: log.trace(f"Found REPL code in \n\n{msg}\n\n") return final.rstrip(), True - def bad_ticks(self, msg: Message): + def has_bad_ticks(self, msg: Message): not_backticks = [ "'''", '"""', "\u00b4\u00b4\u00b4", "\u2018\u2018\u2018", "\u2019\u2019\u2019", "\u2032\u2032\u2032", "\u201c\u201c\u201c", "\u201d\u201d\u201d", "\u2033\u2033\u2033", @@ -259,7 +259,7 @@ class Bot: on_cooldown = (time.time() - self.channel_cooldowns.get(msg.channel.id, 0)) < 300 if not on_cooldown: try: - if self.bad_ticks(msg): + if self.has_bad_ticks(msg): ticks = msg.content[:3] content = self.codeblock_stripping(f"```{msg.content[3:-3]}```", True) if content is None: @@ -359,7 +359,7 @@ class Bot: async def on_message_edit(self, before: Message, after: Message): if before.id in self.codeblock_message_ids\ - and self.codeblock_stripping(after.content, self.bad_ticks(after)) is None: + and self.codeblock_stripping(after.content, self.has_bad_ticks(after)) is None: bot_message = await after.channel.get_message(self.codeblock_message_ids[after.id]) await bot_message.delete() |