aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2025-08-21 13:26:17 +0200
committerAnhgelus Morhtuuzh <william@herges.fr>2025-08-21 13:26:17 +0200
commitbbfaaaf04b69bf74143cf6974e626ce97296edbc (patch)
tree2388a18f81a7c5b9725680afedf58dd6beab6b60 /main.go
parentbda9a5fa8f4af9218bd59364ad6dda2ca26ffc58 (diff)
parent026abcc07a57eeda8a08a746ad2b664e956360f3 (diff)
Merge branch 'main' into refactor/config-command
Diffstat (limited to 'main.go')
-rw-r--r--main.go17
1 files changed, 13 insertions, 4 deletions
diff --git a/main.go b/main.go
index b785259..0c45e6a 100644
--- a/main.go
+++ b/main.go
@@ -4,16 +4,17 @@ import (
_ "embed"
"errors"
"flag"
+ "os"
+ "time"
+
"github.com/anhgelus/gokord"
- cmd "github.com/anhgelus/gokord/cmd"
+ "github.com/anhgelus/gokord/cmd"
"github.com/anhgelus/gokord/logger"
"github.com/anhgelus/les-copaings-bot/commands"
"github.com/anhgelus/les-copaings-bot/config"
"github.com/anhgelus/les-copaings-bot/user"
"github.com/bwmarrin/discordgo"
"github.com/joho/godotenv"
- "os"
- "time"
)
var (
@@ -117,7 +118,15 @@ func main() {
creditsCmd,
},
AfterInit: func(dg *discordgo.Session) {
- stopPeriodicReducer = gokord.NewTimer(24*time.Hour, func(stop chan<- interface{}) {
+ d := 24 * time.Hour
+ if gokord.Debug {
+ d = 24 * time.Second
+ }
+
+ user.PeriodicReducer(dg)
+
+ stopPeriodicReducer = gokord.NewTimer(d, func(stop chan<- interface{}) {
+ logger.Debug("Periodic reducer")
user.PeriodicReducer(dg)
})
},