Documentation ¶
Index ¶
- Constants
- type AuthConfig
- type AuthInfluxConfig
- type Bot
- func (bot *Bot) AddHandler(i ...any)
- func (bot *Bot) Close() error
- func (bot *Bot) GuildUser(guildID discord.GuildID, userID discord.UserID) (*discord.User, error)
- func (bot *Bot) Me() discord.User
- func (bot *Bot) Open(ctx context.Context) error
- func (bot *Bot) ReportError(c bcr.HasContext, err error) error
- func (bot *Bot) Send(guildID discord.GuildID, event any, data SendData)
- func (bot *Bot) ShouldLog() bool
- func (bot *Bot) StateFromGuildID(guildID discord.GuildID) (s *state.State, id int)
- func (bot *Bot) User(userID discord.UserID) (*discord.User, error)
- type BotConfig
- type Config
- type DashboardConfig
- type InfoConfig
- type SendData
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶
type AuthConfig struct { Discord string `toml:"discord"` Postgres string `toml:"postgres"` Redis string `toml:"redis"` Sentry string `toml:"sentry"` Influx AuthInfluxConfig `toml:"influx"` }
type AuthInfluxConfig ¶
type Bot ¶
type Bot struct { Router *bcr.Router DB *db.DB PK *pkgo.Session Metrics *metrics.Client Config Config Cabinet store.Cabinet // contains filtered or unexported fields }
func (*Bot) AddHandler ¶
AddHandler adds handlers to all states.
func (*Bot) GuildUser ¶
GuildUser returns a user from the given guild. If the user is still a member of the guild, it will grab the user from cache. Otherwise, it will request the user object from Discord directly.
func (*Bot) ReportError ¶
func (*Bot) Send ¶
Send either sends a slice of embeds immediately, or queues a single embed. `event` should either be the event received in the handler, or a string name.
func (*Bot) StateFromGuildID ¶
type BotConfig ¶
type BotConfig struct { Owner discord.UserID `toml:"owner"` AESKey string `toml:"aes_key"` CommandsGuildID discord.GuildID `toml:"commands_guild_id"` NoSyncCommands bool `toml:"no_sync_commands"` JoinLeaveLog discord.ChannelID `toml:"join_leave_log"` // Ready event logs MetaLog discord.ChannelID `toml:"meta_log"` // TestMode disables all interaction with Discord that is not necessary for building a cache. // No logging or command responses are done in this mode, invites and members are still fetched. TestMode bool `toml:"test_mode"` // NoAutoMigrate specifies if migrations should be done automatically when the bot starts. // If this is set to true, migrations must be done manually by running the `./catalogger migrate` command. NoAutoMigrate bool `toml:"no_auto_migrate"` }
type Config ¶
type Config struct { Auth AuthConfig `toml:"auth"` Bot BotConfig `toml:"bot"` Dashboard DashboardConfig `toml:"dashboard"` Info InfoConfig `toml:"info"` }
func ReadConfig ¶
type DashboardConfig ¶
type InfoConfig ¶
type InfoConfig struct { SupportServer string `toml:"support_server"` DashboardBase string `toml:"dashboard_base"` HelpFields []discord.EmbedField `toml:"help_fields"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.