# README
What are the performance impacts of this library?
Not a lot for a Discord bot:
THIS IS OUTDATED. TODO: UPDATE.
# Cold functions, or functions that are called once in runtime:
BenchmarkConstructor-8 150537 7617 ns/op
BenchmarkSubcommandConstructor-8 155068 7721 ns/op
# Hot functions, or functions that can be called multiple times:
BenchmarkCall-8 1000000 1194 ns/op
BenchmarkHelp-8 1751619 680 ns/op
# Hot functions, but called implicitly on non-message-create events:
BenchmarkReflectChannelID_1Level-8 10111023 113 ns/op
BenchmarkReflectChannelID_5Level-8 1872080 686 ns/op
# Packages
No description provided by the author
# Functions
IndentLine prefixes every line from input with a single-level indentation.
New makes a new context with a "~" as the prefix.
NewPrefix creates a simple prefix checker using strings.
NewShardFunc creates a shard constructor that shares the same internal store.
NewSubcommand is used to make a new subcommand.
ParseMiddleware parses a middleware function.
Run starts the bot, prints a message into the console, and blocks until SIGINT.
Start quickly starts a bot with the given command.
WaitForInterrupt blocks until SIGINT.
# Variables
Break is a non-fatal error that could be returned from middlewares to stop the chain of execution.
DefaultArgsParser implements a parser similar to that of shell's, implementing quotes as well as escapes.
No description provided by the author
No description provided by the author
HelpUnderline formats command arguments with an underline, similar to manpages.
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
Argument is each argument in a method.
Context is the bot state for commands and subcommands.
No description provided by the author
MethodContext is an internal struct containing fields to make this library work.
No description provided by the author
Subcommand is any form of command, which could be a top-level command or a subcommand.
No description provided by the author
# Interfaces
CanHelp is an interface that subcommands can implement to return its own help message.
CanSetup is used for subcommands to change variables, such as Description.
CustomParser has a CustomParse method, which would be passed in the full message content with the prefix, command, subcommand and space trimmed.
ManualParser has a ParseContent(string) method.
Parser implements a Parse(string) method for data structures that can be used as arguments.
Usager is used in place of the automatically parsed struct name for Parser and other interfaces.
# Type aliases
ArgsParser is the function type for parsing message content into fields, usually delimited by spaces.
ArgumentParts implements ManualParser, in case you want to parse arguments manually.
Prefixer checks a message if it starts with the desired prefix.
RawArguments implements the CustomParser interface, which sets all the arguments into it as raw as it could.