mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
move various functions out of onConnect function so they don't trigger again on each reconnect
This commit is contained in:
parent
b3bc8048cd
commit
d760c0bcb7
|
@ -59,6 +59,8 @@ func main() {
|
|||
}()
|
||||
sugar := logger.Sugar()
|
||||
|
||||
common.StartTime()
|
||||
|
||||
err := godotenv.Load()
|
||||
if err != nil {
|
||||
sugar.Fatal("Error loading .env")
|
||||
|
@ -174,9 +176,14 @@ func main() {
|
|||
|
||||
})
|
||||
|
||||
app.TwitchClient.OnConnect(func() {
|
||||
common.StartTime()
|
||||
app.InitialJoin()
|
||||
// Load the initial timers from the database.
|
||||
app.InitialTimers()
|
||||
|
||||
// Start the timers.
|
||||
app.Scheduler.Start()
|
||||
|
||||
app.TwitchClient.OnConnect(func() {
|
||||
app.TwitchClient.Say("nouryxd", "gopherDance")
|
||||
app.TwitchClient.Say("nourybot", "gopherDance")
|
||||
app.TwitchClient.Say("xnoury", "alienPls")
|
||||
|
@ -193,13 +200,6 @@ func main() {
|
|||
"Helix", helixResp,
|
||||
)
|
||||
|
||||
app.InitialJoin()
|
||||
// Load the initial timers from the database.
|
||||
app.InitialTimers()
|
||||
|
||||
// Start the timers.
|
||||
app.Scheduler.Start()
|
||||
|
||||
})
|
||||
|
||||
// Start status page
|
||||
|
|
Loading…
Reference in a new issue