Utils API Reference

filament.utils.shorthand.prefix_command(name: str, description: str, **kwargs: Any)

Shorthand decorator allowing you to easily define a prefix command. This decorator takes the same arguments as lightbulb.decorators.command.

Example

@filament.utils.prefix_command("foo", "test command")
async def foo(ctx):
    ...
filament.utils.shorthand.prefix_slash_command(name: str, description: str, **kwargs: Any)

Shorthand decorator allowing you to easily define a prefix and slash command. This decorator takes the same arguments as lightbulb.decorators.command.

Example

@filament.utils.prefix_slash_command("foo", "test command")
async def foo(ctx):
    ...
filament.utils.shorthand.slash_command(name: str, description: str, **kwargs: Any)

Shorthand decorator allowing you to easily define a slash command. This decorator takes the same arguments as lightbulb.decorators.command.

Example

@filament.utils.slash_command("foo", "test command")
async def foo(ctx):
    ...
filament.utils.misc.pass_options(func)

First order decorator that causes the decorated command callback function to have all options provided by the context passed as keyword arguments on invocation. This allows you to access the options directly instead of through the context object.

This decorator must be below all other command decorators.

Example

@lightbulb.option("text", "Text to repeat")
@filament.utils.prefix_command("echo", "Repeats the given text")
@filament.utils.pass_options
async def echo(ctx, text):
    await ctx.respond(text)