aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-06-18 09:07:47 +0300
committerGravatar GitHub <[email protected]>2020-06-18 09:07:47 +0300
commitcaa421054669f886750a54fb2fdbea3315c58a58 (patch)
tree4b2529c570b0907f813567e3c5fbc5e2291b70c2
parentSource: Split handling tag and other source items file location (diff)
Source: Exclude `tag` from error message when tags cog not loaded
-rw-r--r--bot/cogs/source.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/bot/cogs/source.py b/bot/cogs/source.py
index 2ca852af3..223552651 100644
--- a/bot/cogs/source.py
+++ b/bot/cogs/source.py
@@ -28,11 +28,14 @@ class SourceConverter(commands.Converter):
return cmd
tags_cog = ctx.bot.get_cog("Tags")
+ show_tag = True
- if tags_cog and argument.lower() in tags_cog._cache:
+ if not tags_cog:
+ show_tag = False
+ elif argument.lower() in tags_cog._cache:
return argument.lower()
- raise commands.BadArgument(f"Unable to convert `{argument}` to valid command, tag, or Cog.")
+ raise commands.BadArgument(f"Unable to convert `{argument}` to valid command{', tag,' if show_tag else ''} or Cog.")
class BotSource(commands.Cog):