Documentation
¶
Index ¶
- Variables
- func UpdatePinnedChampionshipMessage(writeMsgData *types.WriteMessageData, utils types.Utils, ...)
- func WriteChampionshipResetMessage(curChamp, prevChamp *Championship, writeMsgData *types.WriteMessageData, ...)
- type Championship
- func CreateChampionship(name string, startDate time.Time, duration time.Duration) *Championship
- func NewChampionship(name string, startDate time.Time, duration time.Duration, status string, ...) *Championship
- func NewEndedChampionship(name string, startDate time.Time, duration time.Duration, finalRanking []Rank) *Championship
- func ReadFromFile(utils types.Utils) *Championship
- type ChampionshipResetPinnedMessage
- type Effect
- type EffectPresence
- type Rank
- type RankScope
- type User
- type UserMinimal
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Multiplier QuintupleNegativePoints = &Effect{"Mul -5", "Event", "*", -5} QuadrupleNegativePoints = &Effect{"Mul -4", "Event", "*", -4} TripleNegativePoints = &Effect{"Mul -3", "Event", "*", -3} DoubleNegativePoints = &Effect{"Mul -2", "Event", "*", -2} SingleNegativePoints = &Effect{"Mul -1", "Event", "*", -1} DoublePositivePoints = &Effect{"Mul +2", "Event", "*", 2} TriplePositivePoints = &Effect{"Mul +3", "Event", "*", 3} QuadruplePositivePoints = &Effect{"Mul +4", "Event", "*", 4} QuintuplePositivePoints = &Effect{"Mul +5", "Event", "*", 5} SixtuplePositivePoints = &Effect{"Mul +6", "Event", "*", 6} // Additive SubFourPoints = &Effect{"Sub 4", "Event", "-", 4} SubThreePoints = &Effect{"Sub 3", "Event", "-", 3} SubTwoPoints = &Effect{"Sub 2", "Event", "-", 2} SubOnePoint = &Effect{"Sub 1", "Event", "-", 1} AddOnePoint = &Effect{"Add 1", "Event", "+", 1} AddTwoPoints = &Effect{"Add 2", "Event", "+", 2} AddThreePoints = &Effect{"Add 3", "Event", "+", 3} AddFourPoints = &Effect{"Add 4", "Event", "+", 4} AddFivePoints = &Effect{"Add 5", "Event", "+", 5} // Special Effects ComebackBonus1 = &Effect{"Comeback 1", "User", "+", 1} ComebackBonus2 = &Effect{"Comeback 2", "User", "+", 2} ComebackBonus3 = &Effect{"Comeback 3", "User", "+", 3} ComebackBonus4 = &Effect{"Comeback 4", "User", "+", 4} ComebackBonus5 = &Effect{"Comeback 5", "User", "+", 5} LastChanceBonus = &Effect{"Last Chance 1", "User", "+", 2} LastChanceBonus2 = &Effect{"Last Chance 2", "User", "+", 5} ReigningLeader = &Effect{"Reigning Leader", "User", "+", 1} NoNegative = &Effect{"No Negative", "User", "+", 0} ConsistentParticipant1 = &Effect{"Consistent Participant 1", "User", "+", 3} ConsistentParticipant2 = &Effect{"Consistent Participant 2", "User", "+", 5} // Map of all the effects Effects = map[string]*Effect{ "Mul -5": QuintupleNegativePoints, "Mul -3": TripleNegativePoints, "Mul -2": DoubleNegativePoints, "Mul -1": SingleNegativePoints, "Mul +2": DoublePositivePoints, "Mul +3": TriplePositivePoints, "Mul +5": QuintuplePositivePoints, "Mul +6": SixtuplePositivePoints, "Sub 4": SubFourPoints, "Sub 3": SubThreePoints, "Sub 2": SubTwoPoints, "Sub 1": SubOnePoint, "Add 1": AddOnePoint, "Add 2": AddTwoPoints, "Add 3": AddThreePoints, "Add 4": AddFourPoints, "Add 5": AddFivePoints, "Comeback 1": ComebackBonus1, "Comeback 2": ComebackBonus2, "Comeback 3": ComebackBonus3, "Comeback 4": ComebackBonus4, "Comeback 5": ComebackBonus5, "Last Chance": LastChanceBonus, "Last Chance 2": LastChanceBonus2, "Reigning Leader": ReigningLeader, "No Negative": NoNegative, "Consistent Participant 1": ConsistentParticipant1, "Consistent Participant 2": ConsistentParticipant2, } )
Functions ¶
func UpdatePinnedChampionshipMessage ¶ added in v0.4.1
func WriteChampionshipResetMessage ¶ added in v0.4.1
func WriteChampionshipResetMessage(curChamp, prevChamp *Championship, writeMsgData *types.WriteMessageData, utils types.Utils)
Types ¶
type Championship ¶ added in v0.4.1
type Championship struct {
Name string
StartDate time.Time
Duration time.Duration
Status string
FinalRanking []Rank
}
func CreateChampionship ¶ added in v0.4.1
func NewChampionship ¶ added in v0.4.1
func NewEndedChampionship ¶ added in v0.4.1
func ReadFromFile ¶ added in v0.4.1
func ReadFromFile(utils types.Utils) *Championship
func (*Championship) End ¶ added in v0.4.1
func (c *Championship) End(finalRanking []Rank)
func (*Championship) Reset ¶ added in v0.4.1
func (c *Championship) Reset(ranking []Rank, writeMsgData *types.WriteMessageData, utils types.Utils)
func (*Championship) SaveOnFile ¶ added in v0.4.1
func (c *Championship) SaveOnFile(utils types.Utils)
type ChampionshipResetPinnedMessage ¶ added in v0.4.1
var (
PinnedChampionshipResetMessage ChampionshipResetPinnedMessage
)
type EffectPresence ¶ added in v0.2.4
type RankScope ¶ added in v0.4.1
type RankScope string
RankScope is the type used for define the ranking scope (daily, championship, total) during the /ranking command execution
const ( RankScopeDay RankScope = "day" RankScopeChampionship RankScope = "championship" RankScopeTotal RankScope = "total" // DefaultRankScope is the default ranking scope used when no scope is provided DefaultRankScope = RankScopeChampionship )
type User ¶
type User struct {
TelegramUser *tgbotapi.User
TelegramID int64
UserName string
TotalPoints int
TotalEventPartecipations int
TotalEventWins int
DailyPoints int
DailyEventPartecipations int
DailyEventWins int
ChampionshipPoints int
ChampionshipEventPartecipations int
ChampionshipEventWins int
TotalChampionshipPartecipations int
TotalChampionshipWins int
DailyPartecipationStreak int
DailyActivityStreak int
Effects []*Effect
FirstParticipation time.Time
}
func (*User) Minimize ¶ added in v0.2.5
func (u *User) Minimize() *UserMinimal
func (*User) RemoveEffect ¶ added in v0.2.5
func (*User) StringifyEffects ¶ added in v0.2.4
type UserMinimal ¶ added in v0.2.5
Click to show internal directories.
Click to hide internal directories.