diff options
| -rw-r--r-- | bot/exts/info/doc/_cog.py | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/bot/exts/info/doc/_cog.py b/bot/exts/info/doc/_cog.py index 95a772df3..0c255c449 100644 --- a/bot/exts/info/doc/_cog.py +++ b/bot/exts/info/doc/_cog.py @@ -237,18 +237,15 @@ class DocCog(commands.Cog): await self.refresh_event.wait() doc_item = self.doc_symbols.get(symbol_name) + if doc_item is None and " " in symbol_name: + # If an invalid symbol contains a space, check if the command was invoked + # in the format !d <symbol> <message> + symbol_name = symbol_name.split(" ", maxsplit=1)[0] + doc_item = self.doc_symbols.get(symbol_name) + if doc_item is None: - if symbol_name.count(" "): - # If an invalid symbol contains a space, check if the command was invoked - # in the format !d <symbol> <message> - symbol_name = symbol_name.split(" ", maxsplit=1)[0] - doc_item = self.doc_symbols.get(symbol_name) - if doc_item is None: - log.debug("Symbol does not exist.") - return None - else: - log.debug("Symbol does not exist.") - return None + log.debug("Symbol does not exist.") + return None self.bot.stats.incr(f"doc_fetches.{doc_item.package}") |