From d50ae50681f552c9a0d3e2c797b0916a09da54da Mon Sep 17 00:00:00 2001 From: Numerlor <25886452+Numerlor@users.noreply.github.com> Date: Sun, 10 Jan 2021 22:10:12 +0100 Subject: Resolve wrapped command callbacks in the source command Without this the command will fetch the source of the wrapper --- bot/exts/info/source.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bot/exts/info/source.py b/bot/exts/info/source.py index 7b41352d4..ae68ef7e8 100644 --- a/bot/exts/info/source.py +++ b/bot/exts/info/source.py @@ -68,7 +68,10 @@ 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__ + source_item = source_item.callback + while hasattr(source_item, "__wrapped__"): + source_item = source_item.__wrapped__ + src = source_item.__code__ filename = src.co_filename elif isinstance(source_item, str): tags_cog = self.bot.get_cog("Tags") -- cgit v1.2.3