illest.py 2.3.1
Slash commands (app_commands)
Read from the library itself: every signature and every word here is its own docstring.
CommandTree
classillest.app_commands.CommandTree
class CommandTree(client: "'Client'", *, fallback_to_global: 'bool' = True, allowed_contexts: 'Any' = None, allowed_installs: 'Any' = None)
add_command
add_command(command: 'Any', /, *, guild: 'Any' = None, guilds: 'Any' = <object object>, override: 'bool' = False) -> 'None'
remove_command
remove_command(command: 'str', /, *, guild: 'Any' = None, type: 'AppCommandType' = <AppCommandType.chat_input: 1>) -> 'Any'
clear_commands
clear_commands(*, guild: 'Any' = None, type: 'AppCommandType | None' = None) -> 'None'
get_command
get_command(command: 'str', /, *, guild: 'Any' = None, type: 'AppCommandType' = <AppCommandType.chat_input: 1>) -> 'Any'
get_commands
get_commands(*, guild: 'Any' = None, type: 'AppCommandType | None' = None) -> 'list[Any]'
walk_commands
walk_commands(*, guild: 'Any' = None, type: 'AppCommandType' = <AppCommandType.chat_input: 1>) -> 'Iterator[Any]'
copy_global_to
copy_global_to(*, guild: 'Any') -> 'None'
command
command(*, name: 'str | None' = None, description: 'str | None' = None, nsfw: 'bool' = False, guild: 'Any' = None, guilds: 'Any' = <object object>, auto_locale_strings: 'bool' = True, extras: 'dict | None' = None) -> 'Callable[[Callable], Command]'
error
error(function: 'Callable') -> 'Callable'
on_error
asyncasync on_error(interaction: "'Interaction'", error: 'AppCommandError') -> 'None'
Without a handler of its own, the error is logged.
interaction_check
asyncasync interaction_check(interaction: "'Interaction'") -> 'bool'
sync
asyncasync sync(*, guild: 'Any' = None) -> 'list[AppCommand]'
Send this tree's commands (the global ones, or one server's) to the server, replacing what it held for that scope.
fetch_commands
asyncasync fetch_commands(*, guild: 'Any' = None) -> 'list[AppCommand]'
fetch_command
asyncasync fetch_command(command_id: 'Any', /, *, guild: 'Any' = None) -> 'AppCommand'
Command
classillest.app_commands.Command
class Command(*, name: 'str', description: 'str', callback: 'Callable[..., Awaitable[Any]]', nsfw: 'bool' = False, parent: "'Group | None'" = None, guild_ids: 'list[int] | None' = None, auto_locale_strings: 'bool' = True, extras: 'dict | None' = None)
A slash command.
callback
propertyparameters
propertyget_parameter
get_parameter(name: 'str') -> 'Parameter | None'
qualified_name
propertyroot_parent
propertymention
propertyto_dict
to_dict(tree: 'Any' = None) -> 'dict[str, Any]'
error
error(function: 'Callable') -> 'Callable'
autocomplete
autocomplete(name: 'str') -> 'Callable[[Callable], Callable]'
add_check
add_check(predicate: 'Callable') -> 'None'
remove_check
remove_check(predicate: 'Callable') -> 'None'
Group
classillest.app_commands.Group
class Group(*, name: 'str | None' = None, description: 'str | None' = None, parent: "'Group | None'" = None, guild_ids: 'list[int] | None' = None, guild_only: 'bool | None' = None, nsfw: 'bool | None' = None, default_permissions: 'Permissions | None' = None, extras: 'dict | None' = None, **_: 'Any')
A command with subcommands: /tag create, /tag delete. Subclass it (each method a @app_commands.command) or make one
and add to it with @group.command().
commands
propertywalk_commands
walk_commands()
get_command
get_command(name: 'str') -> "'Command | Group | None'"
add_command
add_command(command: "'Command | Group'", *, override: 'bool' = False) -> 'None'
remove_command
remove_command(name: 'str') -> "'Command | Group | None'"
qualified_name
propertyroot_parent
propertycommand
command(*, name: 'str | None' = None, description: 'str | None' = None, nsfw: 'bool' = False, auto_locale_strings: 'bool' = True, extras: 'dict | None' = None) -> 'Callable[[Callable], Command]'
error
error(function: 'Callable') -> 'Callable'
interaction_check
asyncasync interaction_check(interaction: 'Any') -> 'bool'
on_error_default
asyncasync on_error_default(interaction: 'Any', error: 'Exception') -> 'None'
to_dict
to_dict(tree: 'Any' = None) -> 'dict[str, Any]'
ContextMenu
classillest.app_commands.ContextMenu
class ContextMenu(*, name: 'str', callback: 'Callable[..., Awaitable[Any]]', type: 'AppCommandType | None' = None, nsfw: 'bool' = False, guild_ids: 'list[int] | None' = None, extras: 'dict | None' = None)
A command on the right-click menu of a member (illest.Member/User) or a message (illest.Message).
callback
propertyqualified_name
propertyto_dict
to_dict(tree: 'Any' = None) -> 'dict[str, Any]'
error
error(function: 'Callable') -> 'Callable'
Choice
classfrom Genericillest.app_commands.Choice
class Choice(*, name: 'str', value: 'str | int | float')
One of an option's fixed answers: shown as name, handed to the callback as value.
Annotated as Choice[str] (or Choice[int], Choice[float]), the callback is handed the Choice picked
rather than its value.
to_dict
to_dict() -> 'dict[str, Any]'
describe
decoratorillest.app_commands.describe
describe(**parameters: 'str') -> 'Callable[[Any], Any]'
choices
decoratorillest.app_commands.choices
choices(**parameters: 'list[Choice]') -> 'Callable[[Any], Any]'
autocomplete
decoratorillest.app_commands.autocomplete
autocomplete(**parameters: 'Callable') -> 'Callable[[Any], Any]'
rename
decoratorillest.app_commands.rename
rename(**parameters: 'str') -> 'Callable[[Any], Any]'
default_permissions
decoratorillest.app_commands.default_permissions
default_permissions(perms_obj: 'Permissions | None' = None, /, **perms: 'bool') -> 'Callable[[Any], Any]'
guild_only
decoratorillest.app_commands.guild_only
guild_only(target: 'Any' = None) -> 'Any'
Transformer
classillest.app_commands.Transformer
class Transformer()
Turn what was typed into what the callback wants. Override transform; type is the option's own type.
type
propertymin_value
propertymax_value
propertychoices
propertychannel_types
propertytransform
asyncasync transform(interaction: 'Any', value: 'Any', /) -> 'Any'
autocomplete
asyncasync autocomplete(interaction: 'Any', value: 'Any', /) -> 'list[Choice]'
checks
moduleillest.app_commands.checks
app_commands.checks: what may stop a command before it runs.
has_role
has_role(item: 'int | str', /) -> 'Callable'
has_any_role
has_any_role(*items: 'int | str') -> 'Callable'
has_permissions
has_permissions(**perms: 'bool') -> 'Callable'
bot_has_permissions
bot_has_permissions(**perms: 'bool') -> 'Callable'
Cooldown
classclass Cooldown(rate: 'float', per: 'float')
cooldown
cooldown(rate: 'float', per: 'float', *, key: 'Callable[[Any], Hashable] | None' = <function _default_key>) -> 'Callable'
rate uses per per seconds, counted per user by default (key=None counts everybody together).
dynamic_cooldown
dynamic_cooldown(factory: 'Callable[[Any], Cooldown | None]', *, key: 'Callable[[Any], Hashable] | None' = <function _default_key>) -> 'Callable'