aboutsummaryrefslogtreecommitdiff
path: root/user/xp.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <anhgelus@anhgelus.world>2025-05-13 18:06:17 +0200
committerAnhgelus Morhtuuzh <anhgelus@anhgelus.world>2025-05-13 18:06:17 +0200
commitf2fbf1db929e4bd2b3af014fb8d9af4c0f934a1e (patch)
treeb0f10aa56a1bb88aa576e230fdefba9da9be9593 /user/xp.go
parenteaf9fa51cdd9509c5d075633b712ec9b5ea712c7 (diff)
feat(xp): update role after removing all old xp
Diffstat (limited to 'user/xp.go')
-rw-r--r--user/xp.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/user/xp.go b/user/xp.go
index d88e3ce..71a1ced 100644
--- a/user/xp.go
+++ b/user/xp.go
@@ -62,7 +62,7 @@ func (c *Copaing) GetXPForDays(n uint) (uint, error) {
rows, err := gokord.DB.
Model(&CopaingXP{}).
Where(
- "created_at >= '?' and guild_id = ? and copaing_id = ?",
+ "created_at >= ? and guild_id = ? and copaing_id = ?",
exp.TimeStampNDaysBefore(n),
c.GuildID,
c.ID,
@@ -73,13 +73,13 @@ func (c *Copaing) GetXPForDays(n uint) (uint, error) {
return 0, err
}
for rows.Next() {
- var cXP CopaingXP
- err = gokord.DB.ScanRows(rows, &cXP)
+ var cxp CopaingXP
+ err = gokord.DB.ScanRows(rows, &cxp)
if err != nil {
utils.SendAlert("user/xp.go - Scanning rows", err.Error(), "copaing_id", c.ID, "guild_id", c.GuildID)
continue
}
- xp += cXP.XP
+ xp += cxp.XP
}
return xp, nil
}