A Zulip bot agent to sit in our Black Sun. Ever evolving
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

bot improvements

+16 -8
+16 -8
bin/main.ml
··· 16 16 let clock = Eio.Stdenv.clock env in 17 17 18 18 (* Load poe config: explicit path > XDG > current dir > defaults *) 19 - let poe_config = 19 + let poe_config, config_source = 20 20 match config_file with 21 - | Some path -> Poe.Config.load ~fs path 21 + | Some path -> (Poe.Config.load ~fs path, Printf.sprintf "explicit path: %s" path) 22 22 | None -> ( 23 23 match Poe.Config.load_xdg_opt ~fs with 24 - | Some c -> c 24 + | Some c -> (c, "XDG config (~/.config/poe/config.toml)") 25 25 | None -> ( 26 26 match Poe.Config.load_opt ~fs "poe.toml" with 27 - | Some c -> c 28 - | None -> Poe.Config.default)) 27 + | Some c -> (c, "current directory (poe.toml)") 28 + | None -> (Poe.Config.default, "built-in defaults"))) 29 29 in 30 30 31 + Logs.info (fun m -> m "Poe config loaded from %s" config_source); 32 + Logs.info (fun m -> m " Channel: %s, Topic: %s" poe_config.channel poe_config.topic); 33 + Logs.info (fun m -> m " Monorepo: %s, Changes dir: %s" poe_config.monorepo_path poe_config.changes_dir); 34 + let admin_count = List.length poe_config.admin_emails in 35 + if admin_count > 0 then 36 + Logs.info (fun m -> m " Admin users: %d configured (%s)" admin_count 37 + (String.concat ", " poe_config.admin_emails)) 38 + else 39 + Logs.info (fun m -> m " Admin users: none configured"); 40 + 31 41 (* Load zulip bot config from poe's XDG directory *) 32 42 let zulip_config = Zulip_bot.Config.load_or_env ~xdg_app:"poe" ~fs bot_name in 33 43 ··· 38 48 39 49 (* Create and run the bot *) 40 50 let handler = Poe.Handler.make_handler handler_env poe_config in 41 - Logs.info (fun m -> 42 - m "Starting Poe bot, broadcasting to %s/%s" poe_config.channel 43 - poe_config.topic); 51 + Logs.info (fun m -> m "Starting Poe bot..."); 44 52 Zulip_bot.Bot.run ~sw ~env ~config:zulip_config ~handler 45 53 46 54 let run_cmd =