CommandsPlugin class Null safety

The base plugin class. This is used to listen to and register commands.

Note that although this class uses GroupMixin, attempting to access name, description, aliases or any operation dependant on these will result in an UnsupportedError being thrown.

Inheritance
Mixed in types

Constructors

CommandsPlugin({required String prefix(IMessage), Snowflake? guild, CommandsOptions options = const CommandsOptions()})
Create a new CommandsPlugin instance.

Properties

aliases Iterable<String>
A list of aliases that can also be used to refer to this group.
read-only, override
checks Iterable<AbstractCheck>
A list of functions that must return true for any descendant of this group to be executed. These are called before command invocation and can cause it to fail. [...]
read-only, inherited
children Iterable<GroupMixin>
An iterable of all this groups children. [...]
read-only, inherited
childrenMap Map<String, GroupMixin>
A mapping of child names to children. [...]
final, inherited
client INyxx?
The INyxx client this plugin is registered on
read / write
depth int
The depth of this group. [...]
read-only, inherited
description String
A description of what this group represents.
read-only, override
fullName String
The full name of this group. [...]
read-only, inherited
guild Snowflake?
The guild that registered commands will be restricted to. Use for testing, and disable when deploying the bot.
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
hasSlashCommand bool
Whether this group contains any slash commands. [...]
read-only, inherited
interactions IInteractions
The IInteractions instance that this bot uses for managing slash commands.
late, final
name String
The name of this group.
read-only, override
onCommandError Stream<CommandsException>
A Stream of exceptions that occur when processing Commands
late, final
onPostCall Stream<Context>
A Stream of Contexts that emits after Command.execute has successfully been called (no exceptions were thrown).
late, final, inherited
onPreCall Stream<Context>
A Stream of Contexts that emits after the checks have succeeded, but before Command.execute is called.
late, final, inherited
options CommandsOptions
The options for this CommandsPlugin instance.
late, final
parent GroupMixin?
The parent of this group, if any.
read-only, inherited
postCallController StreamController<Context>
@protected, final, inherited
preCallController StreamController<Context>
@protected, final, inherited
prefix String Function(IMessage)
This bot's prefix function
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

addCommand(GroupMixin command) → void
Add a child to this group. [...]
override
addConverter<T>(Converter<T> converter) → void
Add a Converter to this bot.
check(AbstractCheck check) → void
Add a check to this groups checks.
inherited
converterFor(Type type, {bool logWarn = true}) Converter?
If it exists, get the Converter for a given type. [...]
getCommand(StringView view) Command?
Get a Command based off a StringView. [...]
inherited
getOptions(CommandsPlugin commands) Iterable<CommandOptionBuilder>
Build the options for registering this group to the Discord API for slash commands.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
onBotStart(INyxx nyxx, Logger logger) FutureOr<void>
inherited
onBotStop(INyxx nyxx, Logger logger) FutureOr<void>
inherited
onRegister(INyxx nyxx, Logger logger) → void
override
registerChild(GroupMixin child) → void
Add a child to this group. [...]
@Deprecated('Use addCommand() instead'), inherited
toString() String
A string representation of this object. [...]
override
walkCommands() Iterable<Command>
Iterate over all the commands in this group and any subgroups.
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited