Event replay and cleanup

This commit is contained in:
Ava Apples Affine 2025-01-08 00:47:49 +00:00 committed by piper pentagram
parent 2560410820
commit 97bf66c191
8 changed files with 447 additions and 39 deletions

20
main.go
View file

@ -4,10 +4,12 @@ import (
"flag"
"log"
"gitlab.com/whom/bingobot/internal/activity"
"gitlab.com/whom/bingobot/internal/config"
"gitlab.com/whom/bingobot/internal/discord"
"gitlab.com/whom/bingobot/internal/logging"
"gitlab.com/whom/bingobot/internal/state"
"gitlab.com/whom/bingobot/internal/web"
)
var (
@ -32,11 +34,23 @@ func main() {
); err != nil {
log.Fatalf("couldn't initialize state engine: %s", err.Error())
}
if err := activity.Start(); err != nil {
// TODO: handle gracefully and continue?
log.Fatalf("failed to start activity module: %s", err.Error())
}
if err := web.Start(); err != nil {
log.Fatalf("failed to start local web server: %s", err.Error())
}
// start this LAST
if err := state.Start(); err != nil {
log.Fatalf("failed to start state machine: %s", err.Error())
}
defer state.Teardown()
err = startBot()
if err != nil {
if err := startBot(); err != nil {
log.Fatal(err)
}
}