Added !poker and auth entry point

This commit is contained in:
bryce
2025-07-15 20:24:16 +12:00
parent 049051a7e1
commit b0be1f99c8
6 changed files with 271 additions and 5 deletions

View File

@@ -4,9 +4,10 @@ import (
"log"
"os"
"streambot_twitch/internal/auth"
auth "streambot_twitch/internal/auth"
"streambot_twitch/internal/chat"
"streambot_twitch/internal/commands"
"streambot_twitch/internal/points"
twitchapi "streambot_twitch/internal/twitchapi"
tests "streambot_twitch/internal/tests"
twitch "github.com/gempir/go-twitch-irc/v4"
@@ -14,7 +15,7 @@ import (
func main() {
go func() {
if err := oauth.StartOAuthServer(":8080"); err != nil {
if err := auth.StartOAuthServer(":8080"); err != nil {
log.Fatalf("OAuth server error: %v", err)
}
}()
@@ -22,9 +23,9 @@ func main() {
log.Println("OAuth server started on port 8080")
botUsername := os.Getenv("nz_chatterbot")
botOAuth :+ os.Getenv("BOT_OAUTH")
botOAuth := os.Getenv("BOT_OAUTH")
channel := os Getenv("brycefromnz101")
clientID := os.Getenv("TWITCH_CLIENTID")
clientID := os.Getenv("TWITCH_CLIENT_ID")
clientSecret := os.Getenv("TWITCH_CLIENT_SECRET")
botChannel := botUsername
@@ -52,6 +53,14 @@ log.Println("OAuth server started on port 8080")
log.Println("All startup tests passed. Starting bot. . .")
// END of TESTS
// load chat points
if err := points.LoadPoints(); err != nil {
log.Fatalf("Failed to load points: %v", err)
}
// make sure points are saved on exit
defer points.SavePoints()
// load custom commands
if err := commands.LoadCommands(); err != nil {
log.Fatalf("Failed to Load Custom Commands: %v", err)