Documentation
¶
Index ¶
- type Bot
- type BotCore
- type BotServices
- type Config
- type DiscordBot
- func (b *DiscordBot) GetChecksCmd() *cmdchecks.ChecksCommand
- func (b *DiscordBot) GetChecksRepo() *store.ChecksRepo
- func (b *DiscordBot) GetGrafana() grafana.Client
- func (b *DiscordBot) GetHive() hive.Hive
- func (b *DiscordBot) GetHiveSummaryRepo() *store.HiveSummaryRepo
- func (b *DiscordBot) GetMentionsRepo() *store.MentionsRepo
- func (b *DiscordBot) GetMonitorRepo() *store.MonitorRepo
- func (b *DiscordBot) GetQueues() []queue.Queuer
- func (b *DiscordBot) GetRoleConfig() *common.RoleConfig
- func (b *DiscordBot) GetScheduler() *scheduler.Scheduler
- func (b *DiscordBot) GetSession() *discordgo.Session
- func (b *DiscordBot) SetCommands(commands []common.Command)
- func (b *DiscordBot) Start(ctx context.Context) error
- func (b *DiscordBot) Stop(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bot ¶ added in v0.0.11
type Bot interface {
BotCore
BotServices
GetRoleConfig() *common.RoleConfig
SetCommands(commands []common.Command)
GetQueues() []queue.Queuer
}
Bot is the interface for the Discord bot.
func NewBot ¶ added in v0.0.11
func NewBot( log *logrus.Logger, cfg *Config, scheduler *scheduler.Scheduler, monitorRepo *store.MonitorRepo, checksRepo *store.ChecksRepo, mentionsRepo *store.MentionsRepo, hiveSummaryRepo *store.HiveSummaryRepo, grafana grafana.Client, hive hive.Hive, ) (Bot, error)
NewBot creates a new Discord bot.
type BotCore ¶ added in v0.0.11
type BotCore interface {
Start(ctx context.Context) error
Stop(ctx context.Context) error
GetSession() *discordgo.Session
}
BotCore is the core interface for the Discord bot.
type BotServices ¶ added in v0.0.11
type BotServices interface {
GetScheduler() *scheduler.Scheduler
GetMonitorRepo() *store.MonitorRepo
GetChecksRepo() *store.ChecksRepo
GetMentionsRepo() *store.MentionsRepo
GetHiveSummaryRepo() *store.HiveSummaryRepo
GetGrafana() grafana.Client
GetHive() hive.Hive
}
BotServices is the services interface for the Discord bot.
type Config ¶ added in v0.0.11
type Config struct {
DiscordToken string `yaml:"discordToken"`
}
Config represents the configuration for the Discord bot.
func (*Config) AsRoleConfig ¶ added in v0.0.11
func (c *Config) AsRoleConfig() *common.RoleConfig
AsRoleConfig returns the role configuration.
type DiscordBot ¶ added in v0.0.11
type DiscordBot struct {
// contains filtered or unexported fields
}
DiscordBot represents the Discord bot implementation.
func (*DiscordBot) GetChecksCmd ¶ added in v0.0.11
func (b *DiscordBot) GetChecksCmd() *cmdchecks.ChecksCommand
GetChecksCmd returns the checks command.
func (*DiscordBot) GetChecksRepo ¶ added in v0.0.11
func (b *DiscordBot) GetChecksRepo() *store.ChecksRepo
GetChecksRepo returns the checks repository.
func (*DiscordBot) GetGrafana ¶ added in v0.0.11
func (b *DiscordBot) GetGrafana() grafana.Client
GetGrafana returns the Grafana client.
func (*DiscordBot) GetHive ¶ added in v0.0.11
func (b *DiscordBot) GetHive() hive.Hive
GetHive returns the Hive client.
func (*DiscordBot) GetHiveSummaryRepo ¶ added in v0.0.13
func (b *DiscordBot) GetHiveSummaryRepo() *store.HiveSummaryRepo
GetHiveSummaryRepo returns the Hive summary repository.
func (*DiscordBot) GetMentionsRepo ¶ added in v0.0.11
func (b *DiscordBot) GetMentionsRepo() *store.MentionsRepo
GetMentionsRepo returns the mentions repository.
func (*DiscordBot) GetMonitorRepo ¶ added in v0.0.11
func (b *DiscordBot) GetMonitorRepo() *store.MonitorRepo
GetMonitorRepo returns the monitor repository.
func (*DiscordBot) GetQueues ¶ added in v0.0.11
func (b *DiscordBot) GetQueues() []queue.Queuer
GetQueues returns all queues managed by the bot.
func (*DiscordBot) GetRoleConfig ¶ added in v0.0.11
func (b *DiscordBot) GetRoleConfig() *common.RoleConfig
GetRoleConfig returns the role configuration.
func (*DiscordBot) GetScheduler ¶ added in v0.0.11
func (b *DiscordBot) GetScheduler() *scheduler.Scheduler
GetScheduler returns the scheduler.
func (*DiscordBot) GetSession ¶ added in v0.0.11
func (b *DiscordBot) GetSession() *discordgo.Session
GetSession returns the Discord session.
func (*DiscordBot) SetCommands ¶ added in v0.0.11
func (b *DiscordBot) SetCommands(commands []common.Command)
SetCommands sets the commands for the bot.