feat(xp): basic reducer

This commit is contained in:
Anhgelus Morhtuuzh 2024-04-15 18:47:52 +02:00
parent c1e4653a5c
commit 2aaeb2115b
No known key found for this signature in database
GPG key ID: CF4550297832A29F
3 changed files with 13 additions and 1 deletions

View file

@ -42,3 +42,10 @@ func onNewLevel(s *discordgo.Session, m *discordgo.Member, level uint) {
}
}
}
func onLastEventUpdate(c *Copaing) {
h := c.HourSinceLastEvent()
c.XP -= Lose(h, c.XP)
c.Save()
c.SetLastEvent()
}