Documentation ¶
Index ¶
- Constants
- Variables
- func GetBlissfestService() *services.BlissfestService
- func GetBloopyServiceRegistry() models.ServiceRegistry
- func GetBotName() string
- func GetBotToken() string
- func GetFeatures() map[string]config.FeatureConfig
- func GetInspiroClient() *services.InspiroClient
- func GetLogLevel() string
- func GetUser(bloopyId string) models.User
- func IsFeaturedConfigured(key string) bool
- func NewReadinessChecker() health.Checker
- func NewZapLogger() *zap.Logger
- type BloopyEnt
Constants ¶
View Source
const (
BloopyBoiUserAgent = "Mozilla/5.0 (compatible; BloopyBoi/1.0; +https://gitlab.com/h3mmy/bloopyboi)"
)
View Source
const (
ServiceLoggerFieldKey = "service_name"
)
Variables ¶
View Source
var ( AppCommands = []*discordgo.ApplicationCommand{ { Name: "inspire", Description: "Summons Inspiration", }, { Name: "blissfest", Description: "Gets blissfest related information", Options: []*discordgo.ApplicationCommandOption{ { Type: discordgo.ApplicationCommandOptionBoolean, Name: "lineup", Description: "Try to fetch lineup image", Required: true, }, }, }, } AppCommandHandlers = map[string]func(s *discordgo.Session, i *discordgo.InteractionCreate){ "inspire": func(s *discordgo.Session, i *discordgo.InteractionCreate) { bttp := GetInspiroClient() s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{ Type: discordgo.InteractionResponseChannelMessageWithSource, Data: &discordgo.InteractionResponseData{ Embeds: []*discordgo.MessageEmbed{ { Author: &discordgo.MessageEmbedAuthor{}, Image: &discordgo.MessageEmbedImage{ URL: bttp.GetInspiroImageURL(), }, }, }, }, }) }, "blissfest": func(s *discordgo.Session, i *discordgo.InteractionCreate) { getLineUp := false options := i.ApplicationCommandData().Options for _, opt := range options { if opt.Name == "lineup" { getLineUp = opt.BoolValue() } } bsvc := GetBlissfestService() var resData discordgo.InteractionResponseData if getLineUp { resData = discordgo.InteractionResponseData{ Embeds: []*discordgo.MessageEmbed{ { Author: &discordgo.MessageEmbedAuthor{}, Image: &discordgo.MessageEmbedImage{ URL: bsvc.GetLineupImageURI(), }, }, }, Title: "Blissfest", Content: fmt.Sprintf("%s left", humanize.Time(*bsvc.GetStartTime())), } } else { resData = discordgo.InteractionResponseData{ Title: "Blissfest", Content: fmt.Sprintf("%s left", humanize.Time(*bsvc.GetStartTime())), } } s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{ Type: discordgo.InteractionResponseChannelMessageWithSource, Data: &resData, }) }, } )
Functions ¶
func GetBlissfestService ¶ added in v0.4.0
func GetBlissfestService() *services.BlissfestService
func GetBloopyServiceRegistry ¶ added in v0.3.7
func GetBloopyServiceRegistry() models.ServiceRegistry
func GetBotName ¶ added in v0.3.1
func GetBotName() string
func GetInspiroClient ¶ added in v0.4.0
func GetInspiroClient() *services.InspiroClient
func IsFeaturedConfigured ¶ added in v0.3.7
Checks FeatureConfigs for key
func NewReadinessChecker ¶ added in v0.3.0
func NewZapLogger ¶ added in v0.3.7
Types ¶
type BloopyEnt ¶ added in v0.3.11
type BloopyEnt struct {
// contains filtered or unexported fields
}
func NewBloopyEnt ¶ added in v0.3.11
func NewBloopyEnt() *BloopyEnt
func (*BloopyEnt) AddDiscordMessage ¶ added in v0.3.11
Click to show internal directories.
Click to hide internal directories.