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:
+6
-1
@@ -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)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user