Main Classes¶
-
class
base.Bot(prefix=None, *args, **kwargs)¶ Bot class ext.commands-like command parser.
-
command(**kwargs)¶ Register a command directly
-
load_cog(cog_name)¶ Load a cog from a dotted file path
-
unload_cog(cog_name)¶ Unload a code from the cog classname
-
add_command(_command)¶ Add a command dynamically
-
remove_command(command_name)¶ Remove a command dynamically
-
on_message(message)¶ Redirects on_message to process_commands If you decide to override this, make sure to call process_commands
-
process_commands(message)¶ Does command parsing
-
-
class
base.Command(**kwargs)¶ Command dataclass
-
has_subcommands¶ Returns true if the command has subcommands
-
invoke(context)¶ Run the command or optionally subcommands
-
subcommand(**kwargs)¶ Creates a subcommand for the command Used as decorator
-
-
class
base.Cog(bot)¶ Cogs must inherit from this
-
class
base.Context(**kwargs)¶ Contains data about the current command and environment.
message: [discord.Message] - The message for this command author: [discord.User | discord.Member] - The sender of the message
is a discord.User if the message was sent in DMschannel: [discord.Channel] - The current channel guild: [discord.Guild] - The current guild command: [base.Command] - The command invoked bot: [base.Bot] - The bot invoker: [str] - The alias used for this command args: [List[str]] - The arguments used in the message send: [Coroutine] - Sends a message to the channel it was sent in
See the discord.py Messageable.send docs-
update(d)¶ Update contents of the context after init
-
Converters¶
-
class
base.Converter(*args, **kwargs)¶ Put converters as annotations to convert. If given, annotations must be callables, classes with one argument or inherit from this class.
-
convert(arg, ctx)¶ Converts argument, default class returns the argument itself.
-
-
class
base.MentionConverter(typ=None)¶ Converts mentions to objects.
- Accepted types in __init__:
- discord.Member discord.Channel discord.Role
Checking is done with regex