mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-04 00:55:19 +00:00
[commands] Add Context.current_argument
This commit is contained in:
@ -96,6 +96,11 @@ class Context(discord.abc.Messageable, Generic[BotT]):
|
||||
The parameter that is currently being inspected and converted.
|
||||
This is only of use for within converters.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
current_argument: Optional[:class:`str`]
|
||||
The argument string of the :attr:`current_parameter` that is currently being converted.
|
||||
This is only of use for within converters.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
prefix: Optional[:class:`str`]
|
||||
The prefix that was used to invoke the command.
|
||||
@ -141,6 +146,7 @@ class Context(discord.abc.Messageable, Generic[BotT]):
|
||||
subcommand_passed: Optional[str] = None,
|
||||
command_failed: bool = False,
|
||||
current_parameter: Optional[inspect.Parameter] = None,
|
||||
current_argument: Optional[str] = None,
|
||||
):
|
||||
self.message: Message = message
|
||||
self.bot: BotT = bot
|
||||
@ -155,6 +161,7 @@ class Context(discord.abc.Messageable, Generic[BotT]):
|
||||
self.subcommand_passed: Optional[str] = subcommand_passed
|
||||
self.command_failed: bool = command_failed
|
||||
self.current_parameter: Optional[inspect.Parameter] = current_parameter
|
||||
self.current_argument: Optional[str] = current_argument
|
||||
self._state: ConnectionState = self.message._state
|
||||
|
||||
async def invoke(self, command: Command[CogT, P, T], /, *args: P.args, **kwargs: P.kwargs) -> T:
|
||||
|
Reference in New Issue
Block a user