files Completed & new dir & file created

Main.go, Client.go, [DIR] /internal/storage [file] games.json
This commit is contained in:
bryce
2025-07-05 20:45:10 +12:00
parent d50efd4bed
commit 74905368df
4 changed files with 177 additions and 0 deletions

View File

@@ -22,5 +22,29 @@ func main() {
log.Fatal("Please set Bot_Username, Bot_OAuth, Channel, Twitch_Client_ID, and Twitch_Client_Secret env vars")
}
// init Twitch API client
apiClient, err := twitchapi.NewClient(clientID, clientSecret)
if err != nil {
log.Fatalf("Failed to create Twitch API client: %v", err)
}
// load custom commands
if err := commands.LoadCommands(); err != nil {
log.Fatalf("Failed to Load Custom Commands: %v", err)
}
// Create Twitch IRC client
client := twitch.NewClient(botUsername, botOAuth)
client.Join(channel)
// Setup Chat handler
client.OnPrivateMessage(func(message twitch.PrivateMessage) {
chat.HandleMessage(client, apiClient, message)
})
if err := client.Connect(); err != nil {
log.Fatalf("Error connecting to Twitch Chat: %v", err)
}
}