aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/cogs/bot.py17
-rw-r--r--bot/constants.py2
-rw-r--r--config-default.yml7
3 files changed, 16 insertions, 10 deletions
diff --git a/bot/cogs/bot.py b/bot/cogs/bot.py
index 12647bb05..9a5c365fb 100644
--- a/bot/cogs/bot.py
+++ b/bot/cogs/bot.py
@@ -358,8 +358,13 @@ 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.has_bad_ticks(after)) is None:
+ has_fixed_codeblock = (
+ # Checks if the original message was previously called out by the bot
+ before.id in self.codeblock_message_ids
+ # Checks to see if the user has corrected their codeblock
+ and self.codeblock_stripping(after.content, self.has_bad_ticks(after)) is None
+ )
+ if has_fixed_codeblock:
bot_message = await after.channel.get_message(self.codeblock_message_ids[after.id])
await bot_message.delete()
@@ -369,10 +374,10 @@ class Bot:
return
# Finds the appropriate bot message/ user message pair and assigns them to variables
- for k, v in self.codeblock_message_ids.items():
- if v == reaction.message.id:
- user_message = await reaction.message.channel.get_message(k)
- bot_message = await reaction.message.channel.get_message(v)
+ for user_message_id, bot_message_id in self.codeblock_message_ids.items():
+ if bot_message_id == reaction.message.id:
+ user_message = await reaction.message.channel.get_message(user_message_id)
+ bot_message = await reaction.message.channel.get_message(bot_message_id)
break
# If the reaction was clicked on by the author of the user message, deletes the bot message
diff --git a/bot/constants.py b/bot/constants.py
index 568871498..3ade4ac7b 100644
--- a/bot/constants.py
+++ b/bot/constants.py
@@ -248,7 +248,7 @@ class Emojis(metaclass=YAMLGetter):
bullet: str
new: str
pencil: str
- x: str
+ cross_mark: str
class Icons(metaclass=YAMLGetter):
diff --git a/config-default.yml b/config-default.yml
index ed5394b6b..c72fc2231 100644
--- a/config-default.yml
+++ b/config-default.yml
@@ -31,9 +31,10 @@ style:
status_dnd: "<:status_dnd:470326272082313216>"
status_offline: "<:status_offline:470326266537705472>"
- bullet: "\u2022"
- pencil: "\u270F"
- new: "\U0001F195"
+ bullet: "\u2022"
+ pencil: "\u270F"
+ new: "\U0001F195"
+ cross_mark: "\u274C"
icons:
crown_blurple: "https://cdn.discordapp.com/emojis/469964153289965568.png"