config

package
v0.0.0-...-30b4cdb Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BotAllowInput                      bool     `yaml:"botAllowInput"`
	BotMotd                            string   `yaml:"botMotd"`
	BotOldLineupMessage                string   `yaml:"botOldLineupMessage"`
	BotNoDataAvailableYet              string   `yaml:"botNoDataAvailableYet"`
	TelegramDeleteLeftTheGroupMessages bool     `yaml:"telegramDeleteLeftTheGroupMessages"`
	Admins                             []int    `yaml:"secrets.admins,omitempty"`
	Modos                              []int    `yaml:"secrets.modos,omitempty"`
	TelegramToken                      string   `yaml:"secrets.telegramToken,omitempty"`
	ServerToken                        string   `yaml:"secrets.serverToken,omitempty"`
	MapImageDirectory                  string   `yaml:"secrets.mapImageDirectory,omitempty"`
	NbDaysForInput                     int      `yaml:"nbDaysForInput"`
	Buttons                            []string `yaml:"buttons"`
	ReadSetsFromRedisOnRestart         bool     `yaml:"readSetsFromRedisOnRestart"`
	LogFile                            string   `yaml:"secrets.logFile,omitempty"`
	CommandsHistoryLogFile             string   `yaml:"secrets.commandsHistoryLogFile,omitempty"`
	NowSkipClosed                      bool     `yaml:"nowSkipClosed"`
	Port                               int      `yaml:"port"`
	BeginningSchedule                  string   `yaml:"beginningSchedule"`

	Demo   bool   `yaml:"demo"`
	Meta   Meta   `yaml:"meta"`
	Lineup Lineup `yaml:"lineup"`
}

func New

func New(fileName string, isConfigCheck bool) (*Config, error)

func (Config) WriteConfigToFile

func (config Config) WriteConfigToFile(fileName string) error

type Lineup

type Lineup struct {
	BeginningSchedule time.Time        `yaml:"-" json:"-"`
	Rooms             []string         `yaml:"rooms" json:"rooms"`
	Sets              map[string][]Set `yaml:"sets" json:"sets"`
}

type Meta

type Meta struct {
	AboutBigIcon              string    `json:"aboutBigIcon" yaml:"aboutBigIcon"`
	AboutShowPatreonIcon      bool      `json:"aboutShowPatreonIcon" yaml:"aboutShowPatreonIcon"`
	AboutShowShallowBunnyIcon bool      `json:"aboutShowShallowBunnyIcon" yaml:"aboutShowShallowBunnyIcon"`
	AboutShowSisyDuckIcon     bool      `json:"aboutShowSisyDuckIcon" yaml:"aboutShowSisyDuckIcon"`
	BotUrl                    string    `json:"botUrl" yaml:"botUrl"`
	NowMapImage               string    `json:"nowMapImage" yaml:"nowMapImage"`
	NowShowDataSourceAd       bool      `json:"nowShowDataSourceAd" yaml:"nowShowDataSourceAd"`
	NowShowShallowBunnyAd     bool      `json:"nowShowShallowBunnyAd" yaml:"nowShowShallowBunnyAd"`
	NowShowSisyDuckAd         bool      `json:"nowShowSisyDuckAd" yaml:"nowShowSisyDuckAd"`
	NowSubmitPR               string    `json:"nowSubmitPR" yaml:"nowSubmitPR"`
	NowTextAfterMap           string    `json:"nowTextAfterMap" yaml:"nowTextAfterMap"`
	NowTextWhenFinished       string    `json:"nowTextWhenFinished" yaml:"nowTextWhenFinished"`
	MobileAppName             string    `json:"mobileAppName" yaml:"mobileAppName"`
	Prefix                    string    `json:"prefix" yaml:"prefix"`
	RoomYouAreHereEmoticon    string    `json:"roomYouAreHereEmoticon" yaml:"roomYouAreHereEmoticon"`
	Rooms                     []string  `json:"rooms" yaml:"-"`
	Title                     string    `json:"title" yaml:"title"`
	BeginningSchedule         time.Time `json:"beginningSchedule" yaml:"-"`
	TimeZone                  string    `json:"timeZone" yaml:"timeZone"`
	PartyName                 string    `json:"partyName" yaml:"partyName"`
	PartyUrl                  string    `json:"partyUrl" yaml:"partyUrl"`
}

type Set

type Set struct {
	Day      int       `yaml:"day" json:"day"`
	Duration int       `yaml:"duration" json:"duration"`
	Dj       string    `yaml:"dj" json:"dj"`
	Hour     int       `yaml:"hour" json:"hour"`
	Minute   int       `yaml:"minute" json:"minute"`
	Meta     []SetMeta `yaml:"meta" json:"meta"`
}

type SetMeta

type SetMeta struct {
	Key   string `yaml:"key" json:"key"`
	Value string `yaml:"value" json:"value"`
}

Jump to

Keyboard shortcuts

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