diff options
author | 2020-10-02 18:09:09 +0200 | |
---|---|---|
committer | 2020-10-02 18:09:09 +0200 | |
commit | 135345412b697e30685e991a7288d9404e96562c (patch) | |
tree | 2df10d7af59fbc379718e9c84feb36bca3454e83 | |
parent | PR #1206 PEPs: move URL link to title (diff) | |
parent | Merge branch 'master' into source_escape_markdown (diff) |
Merge pull request #1205 from soumitradev/source_escape_markdown
Escape markdown in faulty source commands
-rw-r--r-- | bot/exts/info/source.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bot/exts/info/source.py b/bot/exts/info/source.py index f79be36b0..7b41352d4 100644 --- a/bot/exts/info/source.py +++ b/bot/exts/info/source.py @@ -2,7 +2,7 @@ import inspect from pathlib import Path from typing import Optional, Tuple, Union -from discord import Embed +from discord import Embed, utils from discord.ext import commands from bot.bot import Bot @@ -35,8 +35,10 @@ class SourceConverter(commands.Converter): elif argument.lower() in tags_cog._cache: return argument.lower() + escaped_arg = utils.escape_markdown(argument) + raise commands.BadArgument( - f"Unable to convert `{argument}` to valid command{', tag,' if show_tag else ''} or Cog." + f"Unable to convert '{escaped_arg}' to valid command{', tag,' if show_tag else ''} or Cog." ) |