aboutsummaryrefslogtreecommitdiff
path: root/xp/events.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me>2024-11-25 09:35:44 +0100
committerAnhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me>2024-11-25 09:35:44 +0100
commit50256de97095f619c5a36da6e52eb149d6aceb0e (patch)
treea64af1449bfcc29ddbbcfa62cd941b676f998aa2 /xp/events.go
parentf15c0678b7e0cd3686b37f364cf4c8781a00fcd5 (diff)
refactor(reducer): iterate over users in database
and possible fix of 'shadow' users
Diffstat (limited to 'xp/events.go')
-rw-r--r--xp/events.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/xp/events.go b/xp/events.go
index 90af121..23d4b4b 100644
--- a/xp/events.go
+++ b/xp/events.go
@@ -168,5 +168,5 @@ func onDisconnect(s *discordgo.Session, e *discordgo.VoiceStateUpdate, client *r
func OnLeave(_ *discordgo.Session, e *discordgo.GuildMemberRemove) {
utils.SendDebug("Leave event", "user_id", e.User.ID)
c := GetCopaing(e.User.ID, e.GuildID)
- gokord.DB.Delete(c)
+ gokord.DB.Where("guild_id = ?", e.GuildID).Delete(c)
}