From 36f039a1bffb835a555be8a43976397ba6eb9c76 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Mon, 30 May 2022 08:50:19 -0400 Subject: [PATCH] [commands] Fix interaction baton not being set during Context creation --- discord/ext/commands/context.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/discord/ext/commands/context.py b/discord/ext/commands/context.py index d6924f22b..5e6794495 100644 --- a/discord/ext/commands/context.py +++ b/discord/ext/commands/context.py @@ -279,7 +279,7 @@ class Context(discord.abc.Messageable, Generic[BotT]): message = interaction.message prefix = '/' if data.get('type', 1) == 1 else '\u200b' # Mock the prefix - return cls( + ctx = cls( message=message, bot=bot, view=StringView(''), @@ -290,6 +290,8 @@ class Context(discord.abc.Messageable, Generic[BotT]): invoked_with=command.name, command=command, # type: ignore # this will be a hybrid command, technically ) + interaction._baton = ctx + return ctx async def invoke(self, command: Command[CogT, P, T], /, *args: P.args, **kwargs: P.kwargs) -> T: r"""|coro|