perf(db): remove useless XP data
This commit is contained in:
parent
067e149e72
commit
eaf9fa51cd
3 changed files with 34 additions and 70 deletions
|
@ -1,8 +1,11 @@
|
|||
package exp
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/anhgelus/gokord"
|
||||
"math"
|
||||
"slices"
|
||||
"time"
|
||||
)
|
||||
|
||||
func MessageXP(length uint, diversity uint) uint {
|
||||
|
@ -42,3 +45,15 @@ func LevelXP(level uint) uint {
|
|||
math.Pow(float64(5*level), 2),
|
||||
))
|
||||
}
|
||||
|
||||
// TimeStampNDaysBefore returns the timestamp (year-month-day) n days before today
|
||||
func TimeStampNDaysBefore(n uint) string {
|
||||
var y, d int
|
||||
var m time.Month
|
||||
if gokord.Debug {
|
||||
y, m, d = time.Unix(time.Now().Unix()-int64(24*60*60), 0).Date() // reduce time for debug
|
||||
} else {
|
||||
y, m, d = time.Unix(time.Now().Unix()-int64(n*24*60*60), 0).Date()
|
||||
}
|
||||
return fmt.Sprintf("%d-%d-%d", y, m, d)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue