diff options
| author | LLLL Colonq <llll@colonq> | 2024-10-08 15:57:31 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2024-10-08 15:57:31 -0400 |
| commit | bc18d295497106b2dd23b4b45ac0e17b05949f9c (patch) | |
| tree | 451f3b1b53c721b440661974e84477eae031345a /fig-monitor-twitch/src/Fig/Monitor/Twitch.hs | |
| parent | ab5835df896f899d16ff29ed9db7475579071d77 (diff) | |
Fix gifted
Diffstat (limited to 'fig-monitor-twitch/src/Fig/Monitor/Twitch.hs')
| -rw-r--r-- | fig-monitor-twitch/src/Fig/Monitor/Twitch.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fig-monitor-twitch/src/Fig/Monitor/Twitch.hs b/fig-monitor-twitch/src/Fig/Monitor/Twitch.hs index e72906c..8b11625 100644 --- a/fig-monitor-twitch/src/Fig/Monitor/Twitch.hs +++ b/fig-monitor-twitch/src/Fig/Monitor/Twitch.hs @@ -364,11 +364,14 @@ twitchEventClient cfg busAddr = do let parseEvent o = do payload <- o .: "payload" event <- payload .: "event" - event .: "user_login" + login <- event .: "user_login" + gift <- event .: "is_gift" + pure (login, gift) case Aeson.parseMaybe parseEvent res of - Just nm -> do + Just (nm, False) -> do log $ "New subscriber: " <> nm cmds.publish [sexp|(monitor twitch subscribe)|] [SExprString nm] + Just _ -> log "Skipping gifted subscription" _ -> log "Failed to extract user from subscribe event" Just ("channel.cheer" :: Text) -> do let parseEvent o = do |
