diff options
| author | 2020-06-18 08:13:15 +0300 | |
|---|---|---|
| committer | 2020-06-18 08:13:15 +0300 | |
| commit | 51d681654d9a9acc71763edffcea0d5eb1ef1b29 (patch) | |
| tree | 3b03921a03c2316a0f40fc213bb1fdcce20f95c9 | |
| parent | Source: Refactor Tags cog missing handling (diff) | |
Source: Simplify missing tag cog handling
| -rw-r--r-- | bot/cogs/source.py | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/bot/cogs/source.py b/bot/cogs/source.py index 32a78a0c0..d59371c6e 100644 --- a/bot/cogs/source.py +++ b/bot/cogs/source.py @@ -29,10 +29,7 @@ class SourceConverter(commands.Converter): tags_cog = ctx.bot.get_cog("Tags") - if not tags_cog: - await ctx.send("Unable to get `Tags` cog.") - return commands.ExtensionNotLoaded("bot.cogs.tags") - elif argument.lower() in tags_cog._cache: + if tags_cog and argument.lower() in tags_cog._cache: return argument.lower() raise commands.BadArgument(f"Unable to convert `{argument}` to valid command, tag, or Cog.") @@ -47,10 +44,6 @@ class BotSource(commands.Cog): @commands.command(name="source", aliases=("src",)) async def source_command(self, ctx: commands.Context, *, source_item: SourceConverter = None) -> None: """Display information and a GitHub link to the source code of a command, tag, or cog.""" - # When we have problem to get Tags cog, exit early - if isinstance(source_item, commands.ExtensionNotLoaded): - return - if not source_item: embed = Embed(title="Bot's GitHub Repository") embed.add_field(name="Repository", value=f"[Go to GitHub]({URLs.github_bot_repo})") |