File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ linkFilter reaction =
136136 (\ case
137137 Message { messageContent = message
138138 , messageSender = sender@ Sender { senderRoles = []
139- , senderChannel = TwitchChannel channel
139+ , senderChannel = channel
140140 }
141141 }
142142 | textContainsLink message -> do
@@ -145,5 +145,5 @@ linkFilter reaction =
145145 sender
146146 [qms |Links are not allowed for untrusted users.
147147 Subscribe to gain the trust instantly:
148- https://twitch.tv/{channel}/subscribe|]
148+ https://twitch.tv/{unChannel $ channelToName channel}/subscribe|]
149149 msg -> runReaction reaction msg)
Original file line number Diff line number Diff line change 11{-# LANGUAGE DeriveFunctor #-}
2-
2+ {-# LANGUAGE ViewPatterns #-}
3+ {-# LANGUAGE OverloadedStrings #-}
34module Transport where
45
56import Control.Concurrent.STM
@@ -72,11 +73,12 @@ senderAuthority sender = any (`elem` senderRoles sender) authorityRoles
7273
7374channelToName :: Channel -> ChannelName
7475channelToName (DiscordChannel x) = ChannelName $ T. pack $ show x
75- channelToName (TwitchChannel x) = ChannelName x
76+ channelToName (TwitchChannel (T. uncons -> Just (' #' , x))) = ChannelName x
77+ channelToName (TwitchChannel _) = ChannelName " "
7678
7779newtype ChannelName = ChannelName
7880 { unChannel :: T. Text
79- }
81+ } deriving Eq
8082
8183data InEvent
8284 = Started
You can’t perform that action at this time.
0 commit comments