From 2555a6552fd715e0b2e1e88ad384acebed688a07 Mon Sep 17 00:00:00 2001 From: Kat <65649991+00-kat@users.noreply.github.com> Date: Wed, 1 Jan 2025 00:31:06 +0000 Subject: [PATCH 1/2] Escape underscores in username when ghost-pinging A username like `_therealmitchellh_` would show up as italics, and something like `thereal_mitchellh_` would be even more confusing since only a part of it is in italics. --- app/components/move_message.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/components/move_message.py b/app/components/move_message.py index dc57f35..e971c28 100644 --- a/app/components/move_message.py +++ b/app/components/move_message.py @@ -77,8 +77,9 @@ async def ghostping( ) -> None: await interaction.response.defer(ephemeral=True) await (await self._channel.send(self._author.mention)).delete() + escaped_name = self._author.name.replace("_", "\\_") await interaction.followup.send( - f"Ghostpinged {self._author.name}.", ephemeral=True + f"Ghostpinged {escaped_name}.", ephemeral=True ) From 6cfd02a2dbfcc061ad38aabf7282fb04d157e625 Mon Sep 17 00:00:00 2001 From: Kat <65649991+00-kat@users.noreply.github.com> Date: Wed, 1 Jan 2025 00:46:33 +0000 Subject: [PATCH 2/2] Fix formatting Ruff *really* wants those on the same line, for some reason. --- app/components/move_message.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/components/move_message.py b/app/components/move_message.py index e971c28..d9f1c36 100644 --- a/app/components/move_message.py +++ b/app/components/move_message.py @@ -78,9 +78,7 @@ async def ghostping( await interaction.response.defer(ephemeral=True) await (await self._channel.send(self._author.mention)).delete() escaped_name = self._author.name.replace("_", "\\_") - await interaction.followup.send( - f"Ghostpinged {escaped_name}.", ephemeral=True - ) + await interaction.followup.send(f"Ghostpinged {escaped_name}.", ephemeral=True) class HelpPostTitle(discord.ui.Modal, title="Turn into #help post"):