Documentation
¶
Overview ¶
Package config contains configuration related stuff.
Index ¶
- Variables
- func AdvanceTotalMessages() error
- func GetCustomizableMessage(gid string, key string) (string, error)
- func GetGuildConfValue(id, key string) (string, error)
- func GetPrefix(gid string) string
- func GetTotalMessages() int
- func ResetGuild(gid string)
- func ResetGuildConfValue(id, key string) error
- func ResetGuildMap(gid, key string)
- func SetCustomizableMessage(gid string, key string, message string) error
- func SetGuildConfValue(id, key, value string) error
- type Conf
- type MessageOutOfBounds
Constants ¶
This section is empty.
Variables ¶
var ( // Config contains data loaded from configuration file. Config = parseConfig() // NitoriConfPath contains path to configuration file. NitoriConfPath string // TokenOverride contains the override token passed from command-line arguments. TokenOverride string // VersionStartup indicates weather the program should display version information and exit. VersionStartup bool // LogLevel is the log level. LogLevel = getLogLevel() )
var CustomizableMessages = map[string]string{}
CustomizableMessages maps customizable messages to their default values.
var Prefixes = []string{"conf"}
Prefixes holds a slice of strings that prefixes guild configuration hashmaps.
Functions ¶
func AdvanceTotalMessages ¶
func AdvanceTotalMessages() error
AdvanceTotalMessages advances the total messages processed counter.
func GetCustomizableMessage ¶
GetCustomizableMessage gets a guild-specific message within predefined messages, returning default if not present.
func GetGuildConfValue ¶ added in v1.5.0
GetGuildConfValue gets a configuration value for a specific guild
func GetPrefix ¶
GetPrefix gets the command prefix of a guild and returns the default if none is set.
func GetTotalMessages ¶
func GetTotalMessages() int
GetTotalMessages gets the total amount of messages processed.
func ResetGuild ¶
func ResetGuild(gid string)
ResetGuild deletes all db values that belongs to a specific guild.
func ResetGuildConfValue ¶ added in v1.5.0
ResetGuildConfValue resets a configuration value for a specific guild
func ResetGuildMap ¶ added in v1.5.0
func ResetGuildMap(gid, key string)
ResetGuildMap deletes a map that belongs to a specific guild.
func SetCustomizableMessage ¶
SetCustomizableMessage sets a guild-specific message string within predefined messages.
func SetGuildConfValue ¶ added in v1.5.0
SetGuildConfValue sets a configuration value for a specific guild
Types ¶
type Conf ¶
type Conf struct { System struct { LogLevel string LogPath string Socket string Database string Prefix string Administrator int Operator []int } WebServer struct { Host string Port int BaseURL string Unix bool ForwardedByClientIP bool Secret string RateLimit int RateLimitPeriod int } Discord struct { Token string ClientSecret string Presence string Shard bool ShardCount int CachePerChannel int } LastFM struct { APIKey string APISecret string } }
Conf represents data of a configuration file.
type MessageOutOfBounds ¶
type MessageOutOfBounds struct{}
MessageOutOfBounds represents an out of bounds message.
func (MessageOutOfBounds) Error ¶
func (err MessageOutOfBounds) Error() string