Documentation
¶
Overview ¶
Package cagliostro provides a Discord bot with functionality related to Granblue Fantasy.
Index ¶
- Constants
- type CachedEvent
- type Cagliostro
- func (c *Cagliostro) Close() error
- func (c *Cagliostro) CurrentEvents() (events []*CachedEvent, err error)
- func (c *Cagliostro) OnMessageCreate(s *discordgo.Session, m *discordgo.MessageCreate)
- func (c *Cagliostro) Open() error
- func (c *Cagliostro) UpcomingEvents() (events []*CachedEvent, err error)
- type Logger
Constants ¶
View Source
const ( GBFLogoImageURL = "https://u.nya.is/genvcc.png" GBFLogoImageWidth = 273 GBFLogoImageHeight = 187 )
View Source
const (
EventCacheTTL = 30 * time.Minute
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CachedEvent ¶
type CachedEvent struct {
Event *gbf.Event
Details *gbf.EventDetails
ExpiresAt time.Time
// contains filtered or unexported fields
}
CachedEvent wraps an event, its details, and its expiration date.
type Cagliostro ¶
type Cagliostro struct {
Token string
Prefix string
EmojiDir string
Logger Logger
// contains filtered or unexported fields
}
Cagliostro is the main struct that wraps all the data required by the bot.
func (*Cagliostro) Close ¶
func (c *Cagliostro) Close() error
Close terminates the connection with Discord.
func (*Cagliostro) CurrentEvents ¶
func (c *Cagliostro) CurrentEvents() (events []*CachedEvent, err error)
CurrentEvents returns the ongoing events.
func (*Cagliostro) OnMessageCreate ¶
func (c *Cagliostro) OnMessageCreate(s *discordgo.Session, m *discordgo.MessageCreate)
OnMessageCreate is the event handler for discordgo library.
func (*Cagliostro) UpcomingEvents ¶
func (c *Cagliostro) UpcomingEvents() (events []*CachedEvent, err error)
UpcomingEvents returns the upcoming events.
type Logger ¶
type Logger interface {
Fatal(v ...interface{})
Fatalf(format string, v ...interface{})
Fatalln(v ...interface{})
Panic(v ...interface{})
Panicf(format string, v ...interface{})
Panicln(v ...interface{})
Print(v ...interface{})
Printf(format string, v ...interface{})
Println(v ...interface{})
}
Logger is a basic logging interface.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.