Documentation ¶
Overview ¶
Package handlers contains concrete implementations of the Command interface
Index ¶
- Constants
- Variables
- func InitDaemons(ses *discordgo.Session) (Close func())
- func InitLogs(ses *discordgo.Session)
- func InitPaginated(ses *discordgo.Session, msg *discordgo.Message, title string, lines []string, ...) (unregister func(), needUnregister bool)
- func RouterRoute(argv []string) (commands.Command, int)
- func RouterToSlice() []commands.Command
- func RouterToStringSlice() []string
- type Birthday
- func (b *Birthday) Aliases() []string
- func (n *Birthday) Chans() []string
- func (b *Birthday) Desc() string
- func (b *Birthday) MsgHandle(ses *discordgo.Session, msg *discordgo.Message) (*commands.CommandSend, error)
- func (n *Birthday) Roles() []string
- func (b *Birthday) Subcommands() []commands.Command
- type BirthdayModCheck
- func (b *BirthdayModCheck) Aliases() []string
- func (n *BirthdayModCheck) Chans() []string
- func (b *BirthdayModCheck) Desc() string
- func (b *BirthdayModCheck) MsgHandle(ses *discordgo.Session, msg *discordgo.Message) (*commands.CommandSend, error)
- func (b *BirthdayModCheck) Roles() []string
- func (n *BirthdayModCheck) Subcommands() []commands.Command
- type BirthdayRemove
- func (b *BirthdayRemove) Aliases() []string
- func (n *BirthdayRemove) Chans() []string
- func (b *BirthdayRemove) Desc() string
- func (b *BirthdayRemove) MsgHandle(ses *discordgo.Session, msg *discordgo.Message) (*commands.CommandSend, error)
- func (n *BirthdayRemove) Roles() []string
- func (n *BirthdayRemove) Subcommands() []commands.Command
- type Body
- type Contentlets
- type Data
- type Enrolment_Rules
- type MapCache
- type Offering_Detail
Constants ¶
const (
// HelpAlias is the default alias for help command
HelpAlias = "hg"
)
Variables ¶
var ( ErrNoInput = errors.New("No Course code entered") ErrInvalidFormat = errors.New("Invalid Course Code Format") ErrNotFound = errors.New("Course Not Found") ErrScrapingFailed = errors.New("Web scraping failed, please contact an Exec") )
var ( ErrLoggingOn = errors.New("logging is already on") ErrLoggingOff = errors.New("logging is already off") )
var ( // ErrQuoteIndex means quote index is not valid ErrQuoteIndex = errors.New("index not valid") // ErrQuoteEmpty means quote list is not there ErrQuoteEmpty = errors.New("quote list not initialised") // ErrQuoteNone means user entered no quote ErrQuoteNone = errors.New("no quote entered, please enter a quote") // ErrQueryNone means user entered no quote ErrQueryNone = errors.New("no search terms entered") )
var ( // ErrPlatTooLong means the user tried to create a platform that was too damn long ErrPlatTooLong = errors.New("your platform is too long, keep it under " + strconv.Itoa(platLimit) + " characters") // ErrTagTooLong means the user tried to create a tag that was too damn long ErrTagTooLong = errors.New("your tag is too long, keep it under " + strconv.Itoa(tagLimit) + " characters") // ErrNoTags means there is no tag list ErrNoTags = errors.New("no tags found in database, add a tag to start it") // ErrNoUserTags means there are no tags for the queried user ErrNoUserTags = errors.New("no tags found for that user") // ErrNoPlatform means the user queried a platform that doesn't exist ErrNoPlatform = errors.New("no platform of that name") // ErrNoUser means the user queried a platform they did not have a tag on ErrNoUser = errors.New("you don't have a tag on this platform") // ErrUserNotFound means the user queried a username that doesn't exist on the server ErrUserNotFound = errors.New("user not found") // ErrAddSpam means the user tried to add while a new platform was being waited on ErrAddSpam = errors.New("please do not try add anything while I'm waiting") // ErrCleanSpam means the user tried to clean while a clean is in progress ErrCleanSpam = errors.New("already cleaning, please be patient") )
var (
ErrEmojiNotInit = errors.New("emoji counter not initialised")
)
Functions ¶
func InitDaemons ¶
InitDaemons inits all daemons, returns a function to close all channels when done
func InitLogs ¶
InitLogs inits all logging commands. Needs to be maually updated when adding new loggers
func InitPaginated ¶
func InitPaginated(ses *discordgo.Session, msg *discordgo.Message, title string, lines []string, lineLimit int) (unregister func(), needUnregister bool)
InitPaginated inits a reaction handler for a message to allow pagination
func RouterRoute ¶
RouterRoute is a wrapper around the handler package's internal router's Route method
func RouterToSlice ¶
RouterToSlice is a wrapper around the blah blah blah's ToSlice method
func RouterToStringSlice ¶
func RouterToStringSlice() []string
RouterToStringSlice is a wrapper around the blah blah blah's ToStringSlice method
Types ¶
type Birthday ¶
type Birthday struct { Birthday string `arg:"birthday"` // contains filtered or unexported fields }
func (*Birthday) Subcommands ¶
type BirthdayModCheck ¶
type BirthdayModCheck struct {
// contains filtered or unexported fields
}
func (*BirthdayModCheck) Aliases ¶
func (b *BirthdayModCheck) Aliases() []string
func (*BirthdayModCheck) Desc ¶
func (b *BirthdayModCheck) Desc() string
func (*BirthdayModCheck) MsgHandle ¶
func (b *BirthdayModCheck) MsgHandle(ses *discordgo.Session, msg *discordgo.Message) (*commands.CommandSend, error)
func (*BirthdayModCheck) Roles ¶
func (b *BirthdayModCheck) Roles() []string
func (*BirthdayModCheck) Subcommands ¶
type BirthdayRemove ¶
type BirthdayRemove struct {
// contains filtered or unexported fields
}
func (*BirthdayRemove) Aliases ¶
func (b *BirthdayRemove) Aliases() []string
func (*BirthdayRemove) Desc ¶
func (b *BirthdayRemove) Desc() string
func (*BirthdayRemove) MsgHandle ¶
func (b *BirthdayRemove) MsgHandle(ses *discordgo.Session, msg *discordgo.Message) (*commands.CommandSend, error)
func (*BirthdayRemove) Subcommands ¶
type Body ¶
type Body struct {
Contentlets []Contentlets
}
type Contentlets ¶
type Data ¶
type Data struct { Title string Description string Enrolment_Rules []Enrolment_Rules Offering_Detail Offering_Detail }
type Enrolment_Rules ¶
type Enrolment_Rules struct {
Description string
}
type MapCache ¶
type MapCache struct {
// contains filtered or unexported fields
}
MapCache is a data structure that performs FIFOs insertions to stay under the limit, with indexing support
This implementation uses discordgo messages but can be made generic with interface{}. I just picked a concrete type to avoid typing out a lot of type assertions.
Also need to cache images as well since deleted messages remove all attachments
type Offering_Detail ¶
type Offering_Detail struct {
Offering_Terms string
}