mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-07-02 00:00:02 +00:00
[commands] Fix interaction baton not being set during Context creation
This commit is contained in:
parent
67066937c5
commit
36f039a1bf
@ -279,7 +279,7 @@ class Context(discord.abc.Messageable, Generic[BotT]):
|
|||||||
message = interaction.message
|
message = interaction.message
|
||||||
|
|
||||||
prefix = '/' if data.get('type', 1) == 1 else '\u200b' # Mock the prefix
|
prefix = '/' if data.get('type', 1) == 1 else '\u200b' # Mock the prefix
|
||||||
return cls(
|
ctx = cls(
|
||||||
message=message,
|
message=message,
|
||||||
bot=bot,
|
bot=bot,
|
||||||
view=StringView(''),
|
view=StringView(''),
|
||||||
@ -290,6 +290,8 @@ class Context(discord.abc.Messageable, Generic[BotT]):
|
|||||||
invoked_with=command.name,
|
invoked_with=command.name,
|
||||||
command=command, # type: ignore # this will be a hybrid command, technically
|
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:
|
async def invoke(self, command: Command[CogT, P, T], /, *args: P.args, **kwargs: P.kwargs) -> T:
|
||||||
r"""|coro|
|
r"""|coro|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user