aboutsummaryrefslogtreecommitdiff
path: root/exp
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2026-01-22 21:53:29 +0100
committerAnhgelus Morhtuuzh <william@herges.fr>2026-01-22 21:53:29 +0100
commit3e65b4f6281ddc4039a27a62428db8a95ffc3677 (patch)
treeb1005f908be45aa47da48b604f3863ef23a3d7ea /exp
parent8255a2e51454049f3ac1532f6e1125f528691c37 (diff)
refactor(): completely remove old gokord and finish to update everything to use contexts
Diffstat (limited to 'exp')
-rw-r--r--exp/functions.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/exp/functions.go b/exp/functions.go
index 681c135..8d5b3af 100644
--- a/exp/functions.go
+++ b/exp/functions.go
@@ -1,6 +1,7 @@
package exp
import (
+ "context"
"fmt"
"math"
"regexp"
@@ -8,7 +9,7 @@ import (
"strings"
"time"
- "github.com/anhgelus/gokord"
+ "git.anhgelus.world/anhgelus/les-copaings-bot/common"
)
const DebugFactor = 30
@@ -66,9 +67,9 @@ func LevelXP(level uint) uint {
}
// TimeStampNDaysBefore returns the timestamp (year-month-day) n days before today
-func TimeStampNDaysBefore(n uint) string {
+func TimeStampNDaysBefore(ctx context.Context, n uint) string {
var unix time.Time
- if gokord.Debug {
+ if common.IsDebug(ctx) {
unix = time.Unix(time.Now().Unix()-int64(DebugFactor*n), 0) // reduce time for debug
} else {
unix = time.Unix(time.Now().Unix()-int64(n*24*60*60), 0)