diff options
| author | 2020-03-11 23:36:13 +0000 | |
|---|---|---|
| committer | 2020-03-11 23:36:13 +0000 | |
| commit | 4d333497da0622e0e242b5eee4922932499d2183 (patch) | |
| tree | 9ba1ea0934d6c6383747e20338a54a2dfbb86eca | |
| parent | Merge branch 'master' into spoiler-check (diff) | |
Escape markdown in watchlist triggers
| -rw-r--r-- | bot/cogs/filtering.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bot/cogs/filtering.py b/bot/cogs/filtering.py index 38c28dd00..6651d38e4 100644 --- a/bot/cogs/filtering.py +++ b/bot/cogs/filtering.py @@ -6,6 +6,7 @@ import discord.errors from dateutil.relativedelta import relativedelta from discord import Colour, DMChannel, Member, Message, TextChannel from discord.ext.commands import Cog +from discord.utils import escape_markdown from bot.bot import Bot from bot.cogs.moderation import ModLog @@ -195,8 +196,8 @@ class Filtering(Cog): surroundings = match.string[max(match.start() - 10, 0): match.end() + 10] message_content = ( f"**Match:** '{match[0]}'\n" - f"**Location:** '...{surroundings}...'\n" - f"\n**Original Message:**\n{msg.content}" + f"**Location:** '...{escape_markdown(surroundings)}...'\n" + f"\n**Original Message:**\n{escape_markdown(msg.content)}" ) else: # Use content of discord Message message_content = msg.content |