feat(bots): built-in bot runner + steamfree from UI

- BotRunner: server-side goroutine manager for built-in bot types
- steamfree bot embedded in server (polls Steam API, posts free games)
- bot_type + config JSONB columns on bots table
- Create/Update/Delete handlers manage runner lifecycle
- GET /bots/types returns registered bot types
- BotManager: type selector dropdown + config fields on create
- No SSH needed: create a 'Steam Free Games' bot from /bots/manage
This commit is contained in:
2026-07-15 14:14:02 -04:00
parent c839e67c47
commit 4b32655e67
8 changed files with 488 additions and 30 deletions
+6 -1
View File
@@ -80,6 +80,11 @@ func main() {
hub := gateway.NewHub(database.DB, logger)
go hub.Run()
// Built-in bot runner
botRunner := bot.NewRunner(database.DB, hub, logger)
botRunner.Register("steamfree", bot.SteamFreeBot)
go botRunner.StartAll()
// Giphy client (nil if no API key)
giphyClient := giphy.NewClient(cfg.Giphy.APIKey)
@@ -350,7 +355,7 @@ func main() {
// Bots + slash commands
r.Route("/bots", func(r chi.Router) {
bot.NewHandler(database.DB).RegisterRoutes(r)
bot.NewHandler(database.DB, botRunner).RegisterRoutes(r)
bot.NewCommandHandler(database.DB).RegisterCommandRoutes(r)
})