From 3a795b76a703a048529313ea45e323da82f66d34 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Thu, 1 Aug 2024 19:13:16 -0400 Subject: Add Twitch live monitor --- fig-monitor-twitch/main/Main.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'fig-monitor-twitch/main/Main.hs') diff --git a/fig-monitor-twitch/main/Main.hs b/fig-monitor-twitch/main/Main.hs index 05f3cdb..b306586 100644 --- a/fig-monitor-twitch/main/Main.hs +++ b/fig-monitor-twitch/main/Main.hs @@ -10,14 +10,17 @@ import Fig.Monitor.Twitch.Utils data Command = Monitor | Chatbot - | RedirectServer + | LiveChecker + | RedirectServer Bool | Validate parseCommand :: Parser Command parseCommand = subparser $ mconcat [ command "monitor" $ info (pure Monitor) (progDesc "Launch the Twitch monitor") , command "chatbot" $ info (pure Chatbot) (progDesc "Launch the Twitch chatbot") - , command "user-token-server" $ info (pure RedirectServer) (progDesc "Launch a web server to handle authentication redirects") + , command "live-checker" $ info (pure LiveChecker) (progDesc "Launch the Twitch live status checker") + , command "user-token-server" $ info (pure $ RedirectServer True) (progDesc "Launch a web server to handle authentication redirects") + , command "user-token-server-read-only" $ info (pure $ RedirectServer False) (progDesc "Launch a web server to handle authentication redirects") , command "validate-endpoint" $ info (pure Validate) (progDesc "Test Twitch authentication") ] data Opts = Opts @@ -44,5 +47,6 @@ main = do case opts.command of Monitor -> twitchEventClient cfg (opts.busHost, opts.busPort) Chatbot -> twitchChatClient cfg (opts.busHost, opts.busPort) - RedirectServer -> userTokenRedirectServer cfg + LiveChecker -> twitchChannelLiveMonitor cfg (opts.busHost, opts.busPort) + RedirectServer rw -> userTokenRedirectServer cfg rw Validate -> twitchEndpointTest cfg -- cgit v1.2.3