diff options
| author | Anhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me> | 2024-04-16 15:24:25 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me> | 2024-04-16 15:24:25 +0200 |
| commit | 7fe68106bec7133981ac91026156977e0c7b4ca1 (patch) | |
| tree | 3037ee9508fb52ca96137bfac0679a138d03f37f /main.go | |
| parent | ef39c156f94b854796bb1c2adddfd40a5acaeca8 (diff) | |
feat(reducer): periodic reducer updating xp
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -3,10 +3,12 @@ package main import ( "flag" "github.com/anhgelus/gokord" + "github.com/anhgelus/gokord/utils" "github.com/anhgelus/les-copaings-bot/commands" "github.com/anhgelus/les-copaings-bot/config" "github.com/anhgelus/les-copaings-bot/xp" "github.com/bwmarrin/discordgo" + "time" ) var token string @@ -126,12 +128,12 @@ func afterInit(dg *discordgo.Session) { dg.AddHandler(xp.OnLeave) // setup timer for periodic reducer - //d := 24 * time.Hour - //if gokord.Debug { - // // reduce for debug - // d = time.Minute - //} - //utils.NewTimer(d, func(stop chan struct{}) { - // xp.PeriodicReducer(dg) - //}) + d := 24 * time.Hour + if gokord.Debug { + // reduce time for debug + d = time.Minute + } + utils.NewTimer(d, func(stop chan struct{}) { + xp.PeriodicReducer(dg) + }) } |
