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

@ -30,6 +30,7 @@ func OnMessage(s *discordgo.Session, m *discordgo.MessageCreate) {
return
}
c := GetCopaing(m.Author.ID, m.GuildID)
onLastEventUpdate(c)
// add xp
trimmed := utils.TrimMessage(strings.ToLower(m.Content))
m.Member.User = m.Author
@ -62,6 +63,7 @@ func OnVoiceUpdate(s *discordgo.Session, e *discordgo.VoiceStateUpdate) {
if e.Member.User.Bot {
return
}
onLastEventUpdate(GetCopaing(e.UserID, e.GuildID))
cfg := config.GetGuildConfig(e.GuildID)
if cfg.IsDisabled(e.ChannelID) {
return