package
0.0.0-20211209175121-4e18fe87588a
Repository: https://github.com/mavolin/adam.git
Documentation: pkg.go.dev
# Functions
CheckBotPermissions checks if the discord.Permissions the bot requires for the command are satisfied.
CheckChannelTypes checks if the plugin.ChannelTypes of the command are satisfied.
CheckHuman checks if the invoking message was written by a human.
CheckMessageType checks if the invoking message is of type discord.DefaultMessage.
CheckPrefix checks if the message starts with the prefix.
CheckRestrictions checks if the command is restricted.
No description provided by the author
No description provided by the author
No description provided by the author
DefaultThrottlerCancelCheck checks if the error is an *InformationalError.
FilterGatewayError filters out informational reconnect errors.
FindCommand attempts to find the command being invoked by the message.
InvokeCommand invokes the command and sends a reply, if the command returned one.
New creates a new Bot from the passed options.
NewSettingsRetriever creates a new settings retriever middleware that retrieves the settings from the passed SettingsProvider.
NewThrottlerChecker creates a new bot.Middleware that checks if a command is being throttled.
ParseArgs parses the ctx.RawArgs using the commands plugin.ArgConfig.
SendTyping sends a typing event every 6 seconds until the command finishes executing.
StaticSettings creates a new SettingsProvider that returns the same prefixes for all guilds and users.
# Variables
ErrMiddleware is the error returned if a middleware given to MiddlewareManager.TryAddMiddleware is not a valid middleware type.
ErrUnknownCommand is the error used if a message with a matching prefix does not contain a valid command invoke.
# Structs
Bot is the bot executing all commands.
MiddlewareManager is a struct that can be embedded in commands and modules to provide middleware capabilities.
Options contains different configurations for a Bot.nolint:maligned // only one-time use anyway, ordered by importance, we can take the (temporary) few bytes.
ReplyTypeError is the error used if a reply returned by plugin.Command.Invoke is not of a supported types.
# Interfaces
Middlewarer is an abstraction of a plugin that provides middlewares.
# Type aliases
No description provided by the author
No description provided by the author
A PluginSourceFunc is the function used to retrieve additional plugins from other sources only available at runtime.
SettingsProvider is the function used to retrieve the settings for the guild or direct message.