API Reference¶
Compound Objects¶
- wtf.commands.Command = <wtf.commands._Command object>¶
A complex structure representing a lightbulb
CommandLikeobject. Similar tolightbulb.decorators.command.- Required Parameters:
Namename of the command.Descriptiondescription of the command.Implementscommand types the command implements.
- Optional Parameters:
Executesthe executable callback for the command.Optionsoptions for the command.Checkschecks for the command.ErrorHandlererror handler for the command.Aliasesaliases for the command.Guildsguilds for the command.Subcommandssubcommands for the command.Parserparser for the command.CooldownManagercooldown manager for the command.HelpGetterhelp getter for the command.AutoDeferauto defer value for the command.Ephemeralephemeral value for the command.CheckExemptcheck exempt predicate for the command.Hiddenhidden value for the command.InheritChecksinherit checks value for the command.
Example
cmd = Command[ Implements[lightbulb.PrefixCommand], Name["foo"], Description["test command"], Executes[lambda ctx: ctx.respond("bar")] ]
- wtf.options.Choice = <wtf.options._Choice object>¶
A choice for the option.
- wtf.options.Option = <wtf.options._Option object>¶
A command option.
Multiple Param Objects¶
- wtf.commands.Aliases = <wtf.commands._Aliases object>¶
The aliases for the name of the enclosing command. See
lightbulb.commands.base.CommandLike.aliases.Example
aliases = Aliases["foo", "bar", "baz"]
- wtf.commands.Checks = <wtf.commands._Checks object>¶
The check object(s) to apply to the enclosing command. Similar to lightbulb’s
lightbulb.decorators.add_checksdecorator.- Required Parameters:
*
lightbulb.checks.Checkone or more checks to apply to the enclosing command.
Example
checks = Checks[lightbulb.guild_only, lightbulb.owner_only]
- wtf.commands.Guilds = <wtf.commands._Guilds object>¶
The guilds that the enclosing command will be created in. See
lightbulb.commands.base.CommandLike.guilds.Example
guilds = Guilds[1234, 5678]
- wtf.commands.Implements = <wtf.commands._Implements object>¶
The command type(s) the enclosing command implements. Similar to lightbulb’s
lightbulb.decorators.implementsdecorator.- Required Parameters:
*Type[
lightbulb.commands.base.Command] one or more command types for the enclosing command.
Example
impl = Implements[lightbulb.SlashCommand, lightbulb.PrefixCommand]
- wtf.commands.Subcommands = <wtf.commands._Subcommands object>¶
A container for the enclosing command’s subcommands.
- Required Parameters:
*
Commandone or more commands to register to the enclosing command as subcommands.
Example
subcommands = Subcommands[Command[...], Command[...]]
- wtf.options.Choices = <wtf.options._Choices object>¶
Container for all the option choices.
- wtf.options.Options = <wtf.options._Options object>¶
Container for all the command options.
Single Param Objects¶
- wtf.basic.Description = <wtf.basic._Description object>¶
The description attribute for an object.
- Required Parameters:
strvalue of the object’s description.
Example
description = Description["some description"]
- wtf.basic.Name = <wtf.basic._Name object>¶
The name attribute for an object.
- Required Parameters:
strvalue of the object’s name.
Example
name = Name["some_name"]
- wtf.commands.AutoDefer = <wtf.commands._AutoDefer object>¶
Whether or not the enclosing command’s response will be automatically deferred upon invocation. See
lightbulb.commands.base.CommandLike.auto_defer.- Required Parameters:
boolwhether or not to automatically defer the response of the enclosing command.
Example
defer = AutoDefer[True]
- wtf.commands.CheckExempt = <wtf.commands._CheckExempt object>¶
The check exempt predicate to use for the enclosing command. Similar to
lightbulb.decorators.check_exempt.- Required Parameters:
Syncronous or asyncronous function to use as the enclosing command’s check exempt predicate.
Example
exempt = CheckExempt[lambda ctx: ctx.author.id == 12345]
- wtf.commands.CooldownManager = <wtf.commands._CooldownManager object>¶
The cooldown manager instance to use for the enclosing command. See
lightbulb.commands.base.CommandLike.cooldown_manager.- Required Parameters:
lightbulb.cooldowns.CooldownManagercooldown manager instance for the enclosing command.
Example
manager = CooldownManager[lightbulb.CooldownManager(lambda _: lightbulb.UserBucket(10, 1))]
- wtf.commands.Ephemeral = <wtf.commands._Ephemeral object>¶
Whether or not the enclosing command’s responses will be ephemeral by default. See
lightbulb.commands.base.CommandLike.ephemeral.- Required Parameters:
boolwhether or not to send command responses as ephemeral by default.
Example
ephemeral = Ephemeral[True]
- wtf.commands.ErrorHandler = <wtf.commands._ErrorHandler object>¶
The error handler function to use for the enclosing command. Similar to lightbulb’s
lightbulb.commands.base.CommandLike.set_error_handlerdecorator.- Required Parameters:
Asyncronous function to use as the error handler for the enclosing command.
Example
async def _handler(event: lightbulb.CommandErrorEvent): ... handler = ErrorHandler[_handler]
- wtf.commands.HelpGetter = <wtf.commands._HelpGetter object>¶
The long help text getter function for the enclosing command. See
lightbulb.commands.base.CommandLike.help_getter.- Required Parameters:
Syncronous function returning the long help text for the enclosing command.
Example
getter = HelpGetter[lambda _: "foobar"]
- wtf.commands.Hidden = <wtf.commands._Hidden object>¶
Whether or not the enclosing command should be hidden from the default help command. See
lightbulb.commands.base.CommandLike.hidden.- Required Parameters:
boolwhether or not to hide the enclosing command from the default help command.
Example
hidden = Hidden[True]
- wtf.commands.InheritChecks = <wtf.commands._InheritChecks object>¶
Whether or not the enclosing command should inherit checks from the parent command group. See
lightbulb.commands.base.CommandLike.inherit_checks.- Required Parameters:
boolwhether or not the enclosing command will inherit the parent’s checks.
Example
inherit = InheritChecks[True]
- wtf.commands.Parser = <wtf.commands._Parser object>¶
The parser class to use for the enclosing command. See
lightbulb.commands.base.CommandLike.parser.- Required Parameters:
Type[:obj:`lightbulb.utils.parser.BaseParser] parser class for the enclosing command.
Example
parser = Parser[lightbulb.utils.Parser]
- wtf.executable.Executes = <wtf.executable._Executes object>¶
The syncronous or asyncronous function to execute when the enclosing command is invoked. See
lightbulb.commands.base.CommandLike.callback.- Required Parameters:
Syncronous or asyncronous function to use as the callback for the enclosing command.
Example
- wtf.options.Default = <wtf.options._Default object>¶
The default value for the option.
- wtf.options.Modifier = <wtf.options._Modifier object>¶
The parsing modifier for the option.
- wtf.options.Required = <wtf.options._Required object>¶
Whether or not the option is required. Inferred from the default value if not provided.
- wtf.options.Type = <wtf.options._Type object>¶
The type of the command option.
- wtf.options.Value = <wtf.options._Value object>¶
The value for the option choice.