diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2025-08-21 13:26:17 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2025-08-21 13:26:17 +0200 |
| commit | bbfaaaf04b69bf74143cf6974e626ce97296edbc (patch) | |
| tree | 2388a18f81a7c5b9725680afedf58dd6beab6b60 /main.go | |
| parent | bda9a5fa8f4af9218bd59364ad6dda2ca26ffc58 (diff) | |
| parent | 026abcc07a57eeda8a08a746ad2b664e956360f3 (diff) | |
Merge branch 'main' into refactor/config-command
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -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) }) }, |
