Documentation
¶
Overview ¶
Package action holds common bot actions that can be called via multiple sources.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrTableEmpty = errors.New("table is empty")
ErrTableEmpty is returned if a Random call is made on an empty table.
Functions ¶
This section is empty.
Types ¶
type Announcement ¶ added in v0.1.0
type Announcement struct { ID int `json:"id"` Author string `json:"author"` Message string `json:"message"` Start time.Time `json:"start"` End time.Time `json:"end"` Last time.Time `json:"last"` }
Announcement to make.
func (*Announcement) Empty ¶ added in v0.1.0
func (a *Announcement) Empty() bool
Empty returns true if an Announcement is empty.
func (*Announcement) Update ¶ added in v0.1.0
func (a *Announcement) Update(connection *db.Connection)
Update the last time the Announcement was made.
type Announcements ¶ added in v0.1.0
type Announcements []*Announcement
Announcements to make.
func (*Announcements) Count ¶ added in v0.1.0
func (a *Announcements) Count() int
Count of announcements.
func (*Announcements) Current ¶ added in v0.1.0
func (a *Announcements) Current() *Announcements
Current announcements, that is announcements that have a start time before now and an end time after now.
func (*Announcements) Load ¶ added in v0.1.0
func (a *Announcements) Load(connection *db.Connection)
Load the announcements.
func (*Announcements) Next ¶ added in v0.1.0
func (a *Announcements) Next() *Announcement
Next announcement to make. This is determined by least recently announced item. If neither item has been announced then the item with the earliest start time is next.
type Announcer ¶ added in v0.1.0
type Announcer struct { Refresh bool `json:"refresh"` Bot string `json:"bot"` Channel string `json:"channel"` Last time.Time `json:"last"` Next time.Time `json:"next"` Authors *embed.Authors `json:"-"` Session *discordgo.Session `json:"-"` Connection *db.Connection `json:"-"` // contains filtered or unexported fields }
Announcer used to display Announcements.
type Audit ¶ added in v0.1.5
type Audit struct {
Base
}
Audit action.
func (*Audit) Definition ¶ added in v0.1.5
func (a *Audit) Definition() *command.Definition
Definition for the audit command.
type Base ¶ added in v0.1.0
type Base struct { Command string Description string Connection *db.Connection }
Base action.
type Joke ¶
type Joke struct {
Base
}
Joke action.
func (*Joke) Definition ¶ added in v0.1.0
func (j *Joke) Definition() *command.Definition
Definition for the joke command.
func (*Joke) Get ¶ added in v0.1.0
func (j *Joke) Get(s *discordgo.Session) *discordgo.MessageEmbed
Get a joke as a MessageEmbed.
type Menu ¶
type Menu struct {
Base
}
Menu action.
func (*Menu) Definition ¶ added in v0.1.0
func (m *Menu) Definition() *command.Definition
Definition for the room service command.
type Named ¶ added in v0.1.7
type Named interface {
Names() []string
}
Named data which can have its named returned.
type Preview ¶ added in v0.1.3
Preview commands.
func (*Preview) Definition ¶ added in v0.1.3
func (p *Preview) Definition() *command.Definition
Definition for the room preview command.
func (*Preview) Get ¶ added in v0.1.3
func (p *Preview) Get(id int) Announcement
Get the given announcement.
type Vend ¶ added in v0.1.4
type Vend struct {
Base
}
Vend action.
func (*Vend) Definition ¶ added in v0.1.4
func (m *Vend) Definition() *command.Definition
Definition for the room service command.