From be8df25ecfb9fde6618dbfbd2c1a6503db327c88 Mon Sep 17 00:00:00 2001 From: Red-GitHubBot <88117545+Red-GitHubBot@users.noreply.github.com> Date: Sun, 5 Jun 2022 16:22:02 +0200 Subject: [PATCH] [3.4] Escape Discord's formatting in `[p]servers` command (#5744) (#5756) * Escape formatting in `[p]servers` command * style... (cherry picked from commit 9d50a851ebd23d7323d7841c1d8dd6ea6924a9e6) Co-authored-by: Kreusada <67752638+Kreusada@users.noreply.github.com> Co-authored-by: Kreusada <67752638+Kreusada@users.noreply.github.com> --- redbot/core/core_commands.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index 2b88e55ce..4420ad0f0 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -1645,7 +1645,9 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): Note: This command is interactive. """ guilds = sorted(self.bot.guilds, key=lambda s: s.name.lower()) - msg = "\n".join(f"{guild.name} (`{guild.id}`)\n" for guild in guilds) + msg = "\n".join( + f"{discord.utils.escape_markdown(guild.name)} (`{guild.id}`)\n" for guild in guilds + ) pages = list(pagify(msg, ["\n"], page_length=1000))