nyxx_commands library

A framework for easily creating slash commands and text commands for Discord using the nyxx library.

Classes

AbstractCheck
Represents a check executed on a Command.
Bot
The base bot class. This is used to listen to and register commands.
BotOptions
Optional bot and client settings.
Check
Represents a simple stateless check.
Choices
A decorator used to specify choices for Command arguments.
CombineConverter<R, T>
Object used to combine converters.
Command
A Command is a function bound to a name and arguments.
Context
Contains data about a command's execution context.
Converter<T>
Object used to convert raw argument strings to the type required by the command using them.
CooldownCheck
A Check that checks that a Command is not on cooldown.
Description
A decorator used to specify descriptions of Command arguments.
FallbackConverter<T>
Object used to successivly try similar Converters until a successful parsing is found.
Group
A Group is a simple class that allows GroupMixins to be instanciated.
GuildCheck
A Check that checks for a specific guild.
InteractionContext
Represents a Context triggered by a slash command (Interaction).
MessageContext
Represents a Context triggered by a message sent in a text channel.
Name
A decorator used to specify the Discord name of Command arguments.
RoleCheck
A Check thats checks for a specific role or roles.
StringView
A wrapper class to facilitate operations on a String.
UserCheck
A Check that checks for a specific user or users.

Enums

CommandType
An enum used to specify how a Command can be executed.
CooldownType
Represents different types of cooldown

Mixins

GroupMixin
A Group is a collection of commands. This mixin implements that functionality.

Properties

boolConverter Converter<bool>
Converter to convert input to bools.
final
categoryGuildChannelConverter Converter<CategoryGuildChannel>
Converter to convert input to CategoryGuildChannels.
final
commandNameRegexp RegExp
A RegExp that all command names must match
final
discordTypes Map<Type, CommandOptionType>
Mapping of Dart Types to their Discord API equivalents.
final
doubleConverter Converter<double>
Converter to convert input to doubles.
final
guildChannelConverter Converter<GuildChannel>
Converter to convert input to GuildChannels.
final
intConverter Converter<int>
Converter to convert input to ints.
final
memberConverter Converter<Member>
Converter to convert input to Members.
final
roleConverter Converter<Role>
Converter to convert input to Roles.
final
snowflakeConverter Converter<Snowflake>
Converter to convert input to Snowflakes.
final
stageVoiceChannelConverter Converter<StageVoiceGuildChannel>
Converter to convert input to StageVoiceGuildChannels.
final
stringConverter Converter<String>
Converter to convert input to Strings.
final
textGuildChannelConverter Converter<TextGuildChannel>
Converter to convert input to TextGuildChannels.
final
userConverter Converter<User>
Converter to convert input to Users.
final
voiceGuildChannelConverter Converter<VoiceGuildChannel>
Converter to convert input to VoiceGuildChannels.
final

Functions

convertToKebabCase(String camelCase) String
The function used to convert camelCase identifiers to Discord compatible kebab-case names
parse(Bot bot, Context context, StringView toParse, Type expectedType) Future
Attempt to parse a single argument from an argument view.
registerDefaultConverters(Bot bot) → void
Register default converters for a Bot.

Exceptions / Errors

BadInputException
Base class for exceptions thrown during argument parsing.
CheckFailedException
Exception thrown when an AbstractCheck fails.
CommandInvocationException
Base class for exceptions thrown during command invocation.
CommandNotFoundException
Exception thrown when an unrecognised command is received.
CommandRegistrationError
Error thrown when an invalid command or command structure is registered.
CommandsError
Base class for all errors thrown by this library.
CommandsException
Base class for exceptions thrown by this library.
NoConverterException
Exception thrown when no converter is found for a command argument.
NotEnoughArgumentsException
Exception thrown when a command is invoked without the minimum amount of arguments required.
ParsingException
Exception thrown by StringView when an invalid input is found.
UncaughtException
Exception thrown when an uncaught Exception is thrown by a command callback.