modulepackage
8.1.1+incompatible
Repository: https://github.com/mikemodder/anpan.git
Documentation: pkg.go.dev
# README
anpan
anpan is a command handler for discordgo.
anpan is inspired by Clinet and harmony.
Usage
Check the example
directory for an example for usage of anpan, in addition to an example of a help command.
Examples
Some examples of anpan being used:
- The example bot inside the
example
directory. - My bot, 007Bot-Go.
# Packages
No description provided by the author
# Functions
New creates a new command handler.
WaitForInterrupt makes your application wait for an interrupt.
# Constants
CommandTypeEverywhere defines a command that can be executed anywhere.
CommandTypeGuild defines a command that cannot be executed in direct messages.
CommandTypePrivate defines a command that cannot be executed in a guild.
# Variables
ErrBotBlocked is thrown when the message handler encounters a bot, but ignoring bots was set to true.
ErrCommandAlreadyRegistered is thrown when a command by the same name was registered previously.
ErrCommandNotFound is thrown when a message tries to invoke an unknown command, or when an attempt at removing an unregistered command was made.
ErrDataUnavailable is thrown when data is unavailable, like channels, users or something else.
ErrDMOnly is thrown when a DM-only command is executed on a guild.
ErrGuildOnly is thrown when a guild-only command is executed in direct messages.
ErrOwnerOnly is thrown when an owner-only command is executed.
ErrSelfInsufficientPermissions is thrown when the bot itself does not have enough permissions.
ErrUserInsufficientPermissions is thrown when the user doesn't meet the required permissions.
# Structs
Command represents a command.
CommandHandler contains all the data needed for the handler to function.
Context holds the data required for command execution.
HelpCommand defines a help command.
# Type aliases
CommandFunc defines a normal command's function.
CommandType defines where commands can be used.
DebugFunc is used for debugging output.
HelpCommandFunc defines a help command's function.
OnErrorFunc is the type for the function that can be run.
PrerunFunc is the type for the function that can be run before command execution.