refactor(reducer): iterate over users in database

and possible fix of 'shadow' users
This commit is contained in:
Anhgelus Morhtuuzh 2024-11-25 09:35:44 +01:00
parent f15c0678b7
commit 50256de970
Signed by: anhgelus
GPG key ID: CAD341EFA92DDDE5
2 changed files with 63 additions and 4 deletions

View file

@ -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)
}