aboutsummaryrefslogtreecommitdiff
path: root/xp/events.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me>2024-04-15 18:47:52 +0200
committerAnhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me>2024-04-15 18:47:52 +0200
commit2aaeb2115b25952b71113a683b466c00cb92e690 (patch)
tree6d95b74f7d7e7efcccba5b46200d4c3e161263f3 /xp/events.go
parentc1e4653a5c7ae34dd23d442f67a171eff466aad3 (diff)
feat(xp): basic reducer
Diffstat (limited to 'xp/events.go')
-rw-r--r--xp/events.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/xp/events.go b/xp/events.go
index 4940c0b..c3b843c 100644
--- a/xp/events.go
+++ b/xp/events.go
@@ -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