Categorygithub.com/go-snart/route
modulepackage
0.13.0
Repository: https://github.com/go-snart/route.git
Documentation: pkg.go.dev

# README

route

Command router for Snart.

# Functions

New makes an empty Route with the given State.
NewCmdStore creates a usable CmdStore.
OpenPrefixStore creates a usable PrefixStore and calls Load.

# Constants

GlobalGuildID is the GuildID used for global configurations.
KeyPrefix is the Confy key used to load/store prefixes.

# Variables

ErrCmdNotFound occurs when an unknown command is called.
ErrNoCmd occurs when there is no command after the prefix.
ErrNoLinePrefix occurs when a line doesn't start with a valid prefix.

# Structs

Cmd is a command.
CmdStore is a concurrent-safe store of Cmds.
Prefix is a command prefix.
PrefixStore describes a concurrent-safe store of Guild-specific command prefixes.
Reply wraps a message to be sent to a given ChannelID using a given Session.
Route handles storing and looking up Cmds.
Trigger holds the context that triggered a Command.

# Type aliases

Func is a handler for a Trigger.