Documentation
¶
Index ¶
- Variables
- func CalculateStatus(time time.Time) (bool, int)
- func CalculateValid(time time.Time) bool
- func FirstWeekdayFrom(start time.Time, weekday time.Weekday) time.Time
- func RemoveValue(s []string, value string) []string
- func SplitTime(time time.Time) (int, int, int, int)
- func UpdatePinnedMessage(writeMsgData *types.WriteMessageData, utils types.Utils, ...)
- type DailyRewardedUser
- type EffectPresence
- type Event
- func (e *Event) Activate(by *structs.User, at, telegramAt time.Time, points int)
- func (e *Event) AddEffect(effect *structs.Effect)
- func (e *Event) HasPartecipated(userID int64) bool
- func (e *Event) Partecipate(by *structs.User, at time.Time)
- func (e *Event) Reset()
- func (e *Event) StringifyEffects() string
- type EventActivation
- type EventPartecipation
- type EventsData
- func (ed *EventsData) AssignRandomEffects(utils types.Utils, effects ...structs.EffectPresence)
- func (ed *EventsData) EnabledRandomSets(percentage types.Interval, utils types.Utils) error
- func (ed *EventsData) Reset(newEffects bool, writeMsgData *types.WriteMessageData, utils types.Utils)
- func (ed *EventsData) SaveOnFile(utils types.Utils)
- func (ed *EventsData) WriteResetMessage(writeMsgData *types.WriteMessageData, utils types.Utils)
- type EventsKeys
- type EventsMap
- type EventsResetPinnedMessage
- type EventsStats
- type FuncMap
- type Set
- type SetJson
- type SetJsonSlice
- type SetSlice
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CurrentChampionship *structs.Championship AssignChampionshipWithDefault = func(utils types.Utils) { CurrentChampionship = structs.CreateChampionship("Clocky Championship", FirstWeekdayFrom(time.Now(), time.Sunday), 336*time.Hour) } )
View Source
var ( PinnedResetMessage EventsResetPinnedMessage HintRewardedUsers = make(map[string][]DailyRewardedUser) Events *EventsData AssignEventsWithDefault = func(utils types.Utils) { Events = NewEventsData(true, utils) } )
View Source
var ( SetsFunctions = FuncMap{ "Short Equal": shortEqual, "Repeat": repeat, "Mirror": mirror, "Rise": rise, "Short Rise": shortRise, "Short Fall": shortFall, "Rapid Rise": rapidRise, "Short Rapid Rise": shortRapidRise, "Short Rapid Fall": shortRapidFall, "Double": double, "Short Triple": shortTriple, "Perfect Square": perfectSquare, "Equal Twins": equalTwins, } Sets = SetSlice{ {"Short Equal", "?a:aa", "static", false, shortEqual}, {"Repeat", "ab:ab", "static", false, repeat}, {"Mirror", "ab:ba", "static", false, mirror}, {"Rise", "ab:cd", "static", false, rise}, {"Short Rise", "?a:bc", "static", false, shortRise}, {"Short Fall", "?c:ba", "static", false, shortFall}, {"Rapid Rise", "ac:eg", "static", false, rapidRise}, {"Short Rapid Rise", "?a:ce", "static", false, shortRapidRise}, {"shortRapidFall", "?e:ca", "static", false, shortRapidFall}, {"double", "n:2*n", "static", false, double}, {"shortTriple", "[unnamed]", "static", false, shortTriple}, {"Perfect Square", "[unnamed]", "static", false, perfectSquare}, {"Equal Twins", "aa:bb", "static", false, equalTwins}, } SetsJson = SetJsonSlice{} AssignSetsFromSetsJson = func(utils types.Utils) { Sets = SetsJson.ToSlice() } AssignSetsWithDefault = func(utils types.Utils) { Sets = SetSlice{ {"Short Equal", "?a:aa", "static", false, shortEqual}, {"Repeat", "ab:ab", "static", false, repeat}, {"Mirror", "ab:ba", "static", false, mirror}, {"Rise", "ab:cd", "static", false, rise}, {"Short Rise", "?a:bc", "static", false, shortRise}, {"Short Fall", "?c:ba", "static", false, shortFall}, {"Rapid Rise", "ac:eg", "static", false, rapidRise}, {"Short Rapid Rise", "?a:ce", "static", false, shortRapidRise}, {"Short Rapid Fall", "?e:ca", "static", false, shortRapidFall}, {"Double", "n:2*n", "static", false, double}, {"Short Triple", "[unnamed]", "static", false, shortTriple}, {"Perfect Square", "[unnamed]", "static", false, perfectSquare}, {"Equal Twins", "aa:bb", "static", false, equalTwins}, } } )
Functions ¶
func CalculateValid ¶ added in v0.2.4
func FirstWeekdayFrom ¶ added in v0.4.1
func RemoveValue ¶ added in v0.2.4
func UpdatePinnedMessage ¶ added in v0.2.5
Types ¶
type DailyRewardedUser ¶ added in v0.4.1
type DailyRewardedUser struct {
User *structs.UserMinimal
Sets []string
}
type EffectPresence ¶ added in v0.4.2
type Event ¶ added in v0.2.4
type Event struct {
Time time.Time
Name string
Points int
Enabled bool
Effects []*structs.Effect
Activation *EventActivation
Partecipations map[int64]*EventPartecipation
}
func (*Event) HasPartecipated ¶ added in v0.2.4
func (*Event) Partecipate ¶ added in v0.2.4
func (*Event) StringifyEffects ¶ added in v0.2.5
type EventActivation ¶ added in v0.2.4
type EventPartecipation ¶ added in v0.2.4
type EventsData ¶ added in v0.2.4
type EventsData struct {
Map EventsMap
Keys EventsKeys
Stats EventsStats
}
func NewEventsData ¶ added in v0.2.4
func NewEventsData(newEffects bool, utils types.Utils) *EventsData
func (*EventsData) AssignRandomEffects ¶ added in v0.2.4
func (ed *EventsData) AssignRandomEffects(utils types.Utils, effects ...structs.EffectPresence)
func (*EventsData) EnabledRandomSets ¶ added in v0.2.4
func (*EventsData) Reset ¶ added in v0.2.4
func (ed *EventsData) Reset(newEffects bool, writeMsgData *types.WriteMessageData, utils types.Utils)
func (*EventsData) SaveOnFile ¶ added in v0.2.4
func (ed *EventsData) SaveOnFile(utils types.Utils)
func (*EventsData) WriteResetMessage ¶ added in v0.2.4
func (ed *EventsData) WriteResetMessage(writeMsgData *types.WriteMessageData, utils types.Utils)
type EventsKeys ¶ added in v0.2.0
type EventsKeys []string
type EventsResetPinnedMessage ¶ added in v0.4.1
type EventsStats ¶ added in v0.2.4
type SetJsonSlice ¶ added in v0.2.4
type SetJsonSlice []*SetJson
func (SetJsonSlice) ToSlice ¶ added in v0.2.4
func (sj SetJsonSlice) ToSlice() SetSlice
type SetSlice ¶ added in v0.2.4
type SetSlice []*Set
func (SetSlice) ToJsonSlice ¶ added in v0.2.4
func (s SetSlice) ToJsonSlice() SetJsonSlice
Click to show internal directories.
Click to hide internal directories.