We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a57eb40 commit bc039b0Copy full SHA for bc039b0
1 file changed
src/Bot/CustomCommand.hs
@@ -28,6 +28,7 @@ import Property
28
import Reaction
29
import Text.InterpolatedString.QM
30
import Transport
31
+import qualified Network.URI.Encode as URI
32
33
data CustomCommand = CustomCommand
34
{ customCommandName :: T.Text
@@ -174,6 +175,8 @@ evalExpr :: M.Map T.Text T.Text -> Expr -> T.Text
174
175
evalExpr _ (TextExpr t) = t
176
evalExpr vars (FunCallExpr "or" args) =
177
fromMaybe "" $ listToMaybe $ dropWhile T.null $ map (evalExpr vars) args
178
+evalExpr vars (FunCallExpr "urlencode" args) =
179
+ T.concat $ map (T.pack . URI.encode . T.unpack . evalExpr vars) args
180
evalExpr vars (FunCallExpr funame _) = fromMaybe "" $ M.lookup funame vars
181
182
expandVars :: M.Map T.Text T.Text -> [Expr] -> T.Text
0 commit comments