tanjun.context#
Standard implementations of Tanjun's context classes.
tanjun.context.autocomplete #
Autocomplete context implementation.
AutocompleteContext #
Bases: alluka.BasicContext
, tanjun.AutocompleteContext
Standard implementation of an autocomplete context.
__init__ #
__init__(client, interaction, *, future=None)
Initialise an autocomplete context.
PARAMETER | DESCRIPTION |
---|---|
client |
The Tanjun client this context is bound to. |
interaction |
The autocomplete interaction this context is for.
TYPE:
|
future |
A future used to set the initial response if this is being called through the REST webhook flow.
TYPE:
|
tanjun.context.menu #
Menu context implementation.
MenuContext #
Bases: slash.AppCommandContext
, tanjun.MenuContext
Standard menu command execution context.
__init__ #
__init__(client, interaction, register_task, *, default_to_ephemeral=False, future=None, on_not_found=None)
Initialise a menu command context.
PARAMETER | DESCRIPTION |
---|---|
client |
The Tanjun client this context is bound to. |
interaction |
The command interaction this context is for.
TYPE:
|
register_task |
Callback used to register long-running tasks spawned by this context.
TYPE:
|
future |
A future used to set the initial response if this is being called through the REST webhook flow.
TYPE:
|
default_to_ephemeral |
Whether to default to ephemeral responses.
TYPE:
|
on_not_found |
Callback used to indicate no matching command was found.
TYPE:
|
tanjun.context.message #
Message command implementation.
MessageContext #
Bases: base.BaseContext
, tanjun.MessageContext
Standard implementation of a command context as used within Tanjun.
__init__ #
__init__(client, content, message, register_task, *, triggering_name='', triggering_prefix='')
Initialise a message command context.
PARAMETER | DESCRIPTION |
---|---|
client |
The client to use for sending messages. |
content |
The content of the message (minus any matched prefix and name).
TYPE:
|
message |
The message that triggered the command.
TYPE:
|
register_task |
Callback used to register long-running tasks spawned by this context.
TYPE:
|
triggering_name |
The name of the command that triggered this context.
TYPE:
|
triggering_prefix |
The prefix that triggered this context.
TYPE:
|
tanjun.context.slash #
Slash command implementation.
AppCommandContext #
Bases: base.BaseContext
, tanjun.AppCommandContext
Base class for interaction-based command contexts.
SlashContext #
Bases: AppCommandContext
, tanjun.SlashContext
Standard implementation of tanjun.abc.SlashContext.
__init__ #
__init__(client, interaction, register_task, *, default_to_ephemeral=False, future=None, on_not_found=None)
Initialise a slash command context.
PARAMETER | DESCRIPTION |
---|---|
client |
The Tanjun client this context is bound to. |
interaction |
The command interaction this context is for.
TYPE:
|
register_task |
Callback used to register long-running tasks spawned by this context.
TYPE:
|
default_to_ephemeral |
Whether to default to ephemeral responses.
TYPE:
|
future |
A future used to set the initial response if this is being called through the REST webhook flow.
TYPE:
|
on_not_found |
Callback used to indicate no matching command was found.
TYPE:
|
SlashOption #
Bases: tanjun.SlashOption
Standard implementation of the SlashOption interface.