summaryrefslogtreecommitdiff
path: root/fig-monitor-twitch/main/Main.hs
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2024-08-01 19:13:16 -0400
committerLLLL Colonq <llll@colonq>2024-08-01 19:13:16 -0400
commit3a795b76a703a048529313ea45e323da82f66d34 (patch)
tree7ca774841bd8780e99b0914fcd6cac09b1a6d9eb /fig-monitor-twitch/main/Main.hs
parent7ffb7b021eec46f2d714e04b47d752012e1bf8ea (diff)
Add Twitch live monitor
Diffstat (limited to 'fig-monitor-twitch/main/Main.hs')
-rw-r--r--fig-monitor-twitch/main/Main.hs10
1 files changed, 7 insertions, 3 deletions
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