cfg

package
v0.0.0-...-7404a93 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReloadCfgFromDisk

func ReloadCfgFromDisk()

ReloadCfgFromDisk reloads and reparses the config file from disk

Types

type Config

type Config struct {
	Wadl struct {
		LogLevel string `toml:"log-level"`
		Prefix   string `toml:"prefix"`
		Token    string `toml:"token"`
		GuildID  string `toml:"guild-id"`
	} `toml:"waddles" comment:"General Bot Configuration"`

	Db struct {
		Host string `toml:"host"`
		Port string `toml:"port"`
		User string `toml:"user"`
		Pass string `toml:"pass"`
		Name string `toml:"database-name"`
		URL  string `toml:"url" commented:"true" comment:"uncomment to use a postgres URI instead of above"`
	} `toml:"database" comment:"Postgresql Database Connection Information"`

	NitroPerk struct {
		BoosterChannel struct {
			ParentID string `toml:"parent-id" comment:"Discord catagory ID for channels to be managed under"`
		} `toml:"booster-channel" comment:"server booster personal channel options"`
	} `toml:"nitro" comment:"perks related to being a server booster"`

	Gatekeeper struct {
		Enabled    bool   `toml:"enabled"`
		ChannelID  string `toml:"channel-id"`
		RoleID     string `toml:"role-id"`
		WelcomeMsg string `toml:"welcome-msg"`
		Rules      string `toml:"rules"`
	} `toml:"gatekeeper" comment:"settings related to the gatekeeper function"`

	Permissions struct {
		DebugUsers []string `toml:"bypass-users" comment:"list of user IDs who bypass the permission's system (useful for testing)"` //TODO: reorganize debugusers to different struct
	} `toml:"permissions" comment:"settings related to the permissions system"`
	// contains filtered or unexported fields
}

Config holds bot config information

func Cfg

func Cfg() *Config

Cfg returns the active cfg.Config holding the config information

func ReadConfig

func ReadConfig() *Config

ReadConfig parses the config file into a Config struct

func (Config) GetConfigFileLocation

func (config Config) GetConfigFileLocation(configFile string) string

GetConfigFileLocation returns the full path of the requested configFile

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL