Documentation
¶
Index ¶
- func Find[E any](s []E, filter func(*E) bool) *E
- func IsAlpha(s string) bool
- func MapKeys[M ~map[K]V, K comparable, V any](m M) []K
- func MapTransform[M ~map[K]V, K comparable, V, R any](m M, transform func(K, V) R) []R
- func SliceTransform[E, R any](s []E, transform func(E) R) []R
- func Ternary[T any](cond bool, a, b T) T
- func ToTitle(s string) string
- type AutoReplyConfig
- type BotConfig
- type Config
- type DatabaseConfig
- type ExtendedLogger
- type GooglePlayChannelConfig
- type RoleIDsConfig
- type StarboardConfig
- type ToggleableModule
- type TrollSupportRoleConfig
- type UpdateTrackerConfig
- type UpdateWebhookConfig
- type VoiceTextChatLockerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapKeys ¶
func MapKeys[M ~map[K]V, K comparable, V any](m M) []K
func MapTransform ¶
func MapTransform[M ~map[K]V, K comparable, V, R any](m M, transform func(K, V) R) []R
func SliceTransform ¶
func SliceTransform[E, R any](s []E, transform func(E) R) []R
Types ¶
type AutoReplyConfig ¶
type BotConfig ¶
type BotConfig struct {
ToggleableModule
Token string
OwnerIDs []discord.UserID
RoleIDs *RoleIDsConfig
Starboard *StarboardConfig
AutoPublish bool
TrollSupportRole *TrollSupportRoleConfig
VoiceTextChatLocker *VoiceTextChatLockerConfig
AntiNitroScam bool
NormalizeNicknames bool
AutoReplyConfig *AutoReplyConfig
ApkCacheDir string `json:"-"`
Origin string `json:"-"`
}
type Config ¶
type Config struct {
Bot *BotConfig
Database *DatabaseConfig
UpdateTracker *UpdateTrackerConfig
MaxDownloadVer int
MinDownloadVer int
ApkCacheDir string
Port string
Origin string
}
type DatabaseConfig ¶
type ExtendedLogger ¶
func NewLogger ¶
func NewLogger(prefix string) *ExtendedLogger
func (*ExtendedLogger) LogIfErr ¶
func (logger *ExtendedLogger) LogIfErr(err error)
func (*ExtendedLogger) LogWithCtxIfErr ¶
func (logger *ExtendedLogger) LogWithCtxIfErr(context string, errs ...error)
LogWithCtxIfErr logs one or more errors with context. Context should be simple description with -ing verb like "adding role" (will be logged as "Exception while adding role")
func (*ExtendedLogger) PanicIfErr ¶
func (logger *ExtendedLogger) PanicIfErr(err error)
type GooglePlayChannelConfig ¶
type RoleIDsConfig ¶
type StarboardConfig ¶
type ToggleableModule ¶
type ToggleableModule struct {
Enabled bool
}
type TrollSupportRoleConfig ¶
type TrollSupportRoleConfig struct {
ToggleableModule
ID discord.RoleID
}
type UpdateTrackerConfig ¶
type UpdateTrackerConfig struct {
ToggleableModule
Cache string
IgnoreFirstUpdate bool
Webhook *UpdateWebhookConfig
GooglePlay map[string]GooglePlayChannelConfig
}
type UpdateWebhookConfig ¶
type UpdateWebhookConfig struct {
ToggleableModule
ID discord.WebhookID
Token string
}
type VoiceTextChatLockerConfig ¶
type VoiceTextChatLockerConfig struct {
ToggleableModule
Voice discord.ChannelID
Text discord.ChannelID
}
Click to show internal directories.
Click to hide internal directories.