summaryrefslogtreecommitdiff
path: root/fig-monitor-twitch/src/Fig/Monitor/Twitch
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2026-04-21 02:51:31 -0400
committerLLLL Colonq <llll@colonq>2026-04-21 02:51:31 -0400
commit6070421019832c94e48b988ac996bf99cf3ccd5f (patch)
tree0fc3d917b1380b7062e75bead323b5b37592a564 /fig-monitor-twitch/src/Fig/Monitor/Twitch
parent7a07562c61091178e540803a8c70ce5d088c5dfa (diff)
fig-monitor-twitch: Send username in addition to display name
Diffstat (limited to 'fig-monitor-twitch/src/Fig/Monitor/Twitch')
-rw-r--r--fig-monitor-twitch/src/Fig/Monitor/Twitch/Chatbot.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/fig-monitor-twitch/src/Fig/Monitor/Twitch/Chatbot.hs b/fig-monitor-twitch/src/Fig/Monitor/Twitch/Chatbot.hs
index 92f6830..4886ffb 100644
--- a/fig-monitor-twitch/src/Fig/Monitor/Twitch/Chatbot.hs
+++ b/fig-monitor-twitch/src/Fig/Monitor/Twitch/Chatbot.hs
@@ -46,10 +46,11 @@ twitchChatbot cfg busAddr = do
cmds.publish "fig monitor twitch chat user-notice" . encodeUtf8 $ Text.unwords msg.params
"PRIVMSG"
| Just displaynm <- Map.lookup "display-name" msg.tags
+ , Just pfx <- msg.prefix
, Nothing <- Map.lookup "custom-reward-id" msg.tags -> do
log $ "Received chat message from: " <> displaynm
cmds.publish "fig monitor twitch chat incoming" . encodeUtf8 . Text.unwords $
- [ displaynm
+ [ displaynm, "\t", fst $ Text.breakOn "!" pfx
, Text.intercalate "\n" $ (\(key, v) -> key <> "\t" <> v) <$> Map.toList msg.tags
] <> drop 1 msg.params
_ -> pure ()