From 1282cf4a624499cd5886f91deb8e1f45ffc14fe3 Mon Sep 17 00:00:00 2001 From: Joscha Date: Mon, 19 Feb 2018 23:10:21 +0000 Subject: [PATCH] Run commands in new threads --- src/EuphApi/Utils.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/EuphApi/Utils.hs b/src/EuphApi/Utils.hs index aafe363..65a6d48 100644 --- a/src/EuphApi/Utils.hs +++ b/src/EuphApi/Utils.hs @@ -113,9 +113,9 @@ type CommandName = T.Text -- | Runs a list of commands. runCommands :: [Command b c] -> E.Message -> B.Bot b c () --- runCommands cs m = void $ sequence $ map ($m) cs --- runCommands cs m = void . sequence $ cs <*> pure m -runCommands cs = void . sequence . sequence cs +-- runCommands cs m = mapM_ B.fork $ map ($m) cs +-- runCommands cs m = mapM_ B.fork $ cs <*> pure m +runCommands cs = mapM_ B.fork . sequence cs withContent :: (T.Text -> a) -> E.Message -> a withContent f = f . E.msgContent