instrukt.commands.command.Command

class instrukt.commands.command.Command(name: str, callback: ~typing.Callable[[...], ~typing.Awaitable[~typing.Any | None]], description: str | None = <MISSING>, alias: str | None = None, parent: ~instrukt.commands.command.CmdGroup | None = None, help: str | None = <MISSING>)[source]

Bases: object

A command class representing a command that can be executed in the REPL.

Parameters:
  • callback – A function that takes at least a context and

  • Optional[Any]. (returns) –

Methods

__init__(name, callback[, description, ...])

execute(ctx, *args)

Execute the command with the given arguments.

Attributes

root_parent

Return the root parent of this command

async execute(ctx, *args) Any | None[source]

Execute the command with the given arguments.

property root_parent: CmdGroup | None

Return the root parent of this command