pylav.type_hints package#
Submodules#
pylav.type_hints.bot module#
- class pylav.type_hints.bot.BotClientWithLavalinkType(*args, cli_flags=None, bot_dir=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/pylav/checkouts/latest/docs'), **kwargs)[source]#
Bases:
Red
- async get_context(message, *, cls=None)[source]#
-
Returns the invocation context from the message or interaction.
This is a more low-level counter-part for
process_commands()
to allow users more fine grained control over the processing.The returned context is not guaranteed to be a valid invocation context,
Context.valid
must be checked to make sure it is. If the context is not valid then it is not a valid candidate to be invoked underinvoke()
.Note
In order for the custom context to be used inside an interaction-based context (such as
HybridCommand
) then this method must be overridden to return that class.Changed in version 2.0:
message
parameter is now positional-only and renamed toorigin
.- Parameters:
origin (
Union[:class:`discord.Message`
,discord.Interaction
]) – The message or interaction to get the invocation context from.cls – The factory class that will be used to create the context. By default, this is
Context
. Should a custom class be provided, it must be similar enough toContext
's interface.
- Returns:
The invocation context. The type of this can change via the
cls
parameter.- Return type:
Context
- lavalink#
- pylav#