feat(debug): adapt xp functions while debug is enabled

This commit is contained in:
Anhgelus Morhtuuzh 2024-04-15 19:15:37 +02:00
parent 84bf4caed2
commit 9f9c27f422
No known key found for this signature in database
GPG key ID: CF4550297832A29F
2 changed files with 13 additions and 1 deletions

View file

@ -9,6 +9,7 @@ import (
"github.com/bwmarrin/discordgo"
"github.com/redis/go-redis/v9"
"gorm.io/gorm"
"math"
"strconv"
"time"
)
@ -98,6 +99,9 @@ func (c *Copaing) HourSinceLastEvent() uint {
)
return 0
}
if gokord.Debug {
return uint(math.Floor(float64(t-int64(last)) / 60)) // not hours of unix, is minutes of unix
}
return utils.HoursOfUnix(t - int64(last))
}