aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/evergreen/source.py
diff options
context:
space:
mode:
authorGravatar Icebluewolf <[email protected]>2021-05-19 17:21:55 -0500
committerGravatar GitHub <[email protected]>2021-05-19 17:21:55 -0500
commit4a7ced4d36c061256fe19b0ee3e8baef3bfc24fe (patch)
treec83c50f3342c1cb6141915c455ce1963e837bf5e /bot/exts/evergreen/source.py
parentremove unnecessary check (diff)
parentMerge pull request #744 from python-discord/remove-superfluous-dependencies (diff)
Merge branch 'main' into http_status_command_randomness
Diffstat (limited to 'bot/exts/evergreen/source.py')
-rw-r--r--bot/exts/evergreen/source.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/bot/exts/evergreen/source.py b/bot/exts/evergreen/source.py
index 8fb72143..fc209bc3 100644
--- a/bot/exts/evergreen/source.py
+++ b/bot/exts/evergreen/source.py
@@ -33,7 +33,8 @@ class BotSource(commands.Cog):
Raise BadArgument if `source_item` is a dynamically-created object (e.g. via internal eval).
"""
if isinstance(source_item, commands.Command):
- src = source_item.callback.__code__
+ callback = inspect.unwrap(source_item.callback)
+ src = callback.__code__
filename = src.co_filename
else:
src = type(source_item)
@@ -64,12 +65,8 @@ class BotSource(commands.Cog):
url, location, first_line = self.get_source_link(source_object)
if isinstance(source_object, commands.Command):
- if source_object.cog_name == "Help":
- title = "Help Command"
- description = source_object.__doc__.splitlines()[1]
- else:
- description = source_object.short_doc
- title = f"Command: {source_object.qualified_name}"
+ description = source_object.short_doc
+ title = f"Command: {source_object.qualified_name}"
else:
title = f"Cog: {source_object.qualified_name}"
description = source_object.description.splitlines()[0]