aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Matteo Bertucci <[email protected]>2021-08-23 19:04:03 +0200
committerGravatar GitHub <[email protected]>2021-08-23 19:04:03 +0200
commitf640c5f5e02d92135f56ca809fab4188a957d07d (patch)
tree80f76f7f4c1c5d893fc5842631dcbc7692421441
parentUpdate reminders command to use `UserMentionOrID` instead of `discord.Member`... (diff)
parentEscape markdown in user's name for `!user` command (diff)
Merge pull request #1771 from python-discord/TizzySaurus-patch-1
Escape markdown in user's name for `!user` command
-rw-r--r--bot/exts/info/information.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/bot/exts/info/information.py b/bot/exts/info/information.py
index a9ea403f7..8bef6a8cd 100644
--- a/bot/exts/info/information.py
+++ b/bot/exts/info/information.py
@@ -8,6 +8,7 @@ from typing import Any, DefaultDict, Mapping, Optional, Tuple, Union
import rapidfuzz
from discord import AllowedMentions, Colour, Embed, Guild, Message, Role
from discord.ext.commands import BucketType, Cog, Context, Paginator, command, group, has_any_role
+from discord.utils import escape_markdown
from bot import constants
from bot.api import ResponseCodeError
@@ -244,6 +245,7 @@ class Information(Cog):
name = str(user)
if on_server and user.nick:
name = f"{user.nick} ({name})"
+ name = escape_markdown(name)
if user.public_flags.verified_bot:
name += f" {constants.Emojis.verified_bot}"