@@ -8,7 +8,6 @@ module Bot.Help
88 , startRefreshHelpGistTimer
99 ) where
1010
11- import Data.Proxy
1211import Bot.CustomCommand
1312import Bot.GitHub
1413import Bot.Replies
@@ -17,6 +16,7 @@ import Data.Bool.Extra
1716import Data.Functor
1817import qualified Data.Map as M
1918import Data.Maybe
19+ import Data.Proxy
2020import qualified Data.Text as T
2121import Effect
2222import Entity
@@ -25,10 +25,11 @@ import Reaction
2525import Text.InterpolatedString.QM
2626import Transport
2727
28- data HelpState = HelpState
29- { helpStateGistId :: Maybe GistId
30- , helpStateGistFresh :: Bool
31- }
28+ data HelpState =
29+ HelpState
30+ { helpStateGistId :: Maybe GistId
31+ , helpStateGistFresh :: Bool
32+ }
3233
3334updateHelpStateGistId :: GistId -> HelpState -> HelpState
3435updateHelpStateGistId (GistId " " ) state = state {helpStateGistId = Nothing }
@@ -81,22 +82,24 @@ gistRenderCustomCommand (CustomCommand name message times) =
8182 [qms ||{name}|{message}|{times}||]
8283
8384gistRenderCommandTable :: CommandTable -> T. Text
84- gistRenderCommandTable = (" * Builtin Commands \n " <> ) .
85+ gistRenderCommandTable =
86+ (" * Builtin Commands \n " <> ) .
8587 T. unlines . map gistRenderBuiltinCommand . M. toList
8688
8789-- TODO(#649): Help Gist Page does not include CustomCommands
8890refreshHelpGist :: CommandTable -> GistId -> Effect ()
8991refreshHelpGist commandTable gistId = do
9092 customsList <- getCustomCommands
91- let customCommands = T. unlines $ gistRenderCustomCommand . entityPayload <$> customsList
93+ let customCommands =
94+ T. unlines $ gistRenderCustomCommand . entityPayload <$> customsList
9295 updateGistFile
9396 helpGistFileName
9497 (FileContent (gistText <> " \n * Custom commands \n " <> customCommands))
9598 gistId
96- where
97- gistText = gistRenderCommandTable commandTable
99+ where
100+ gistText = gistRenderCommandTable commandTable
98101
99- getCustomCommands :: Effect ( [Entity CustomCommand ])
102+ getCustomCommands :: Effect [Entity CustomCommand ]
100103getCustomCommands = selectEntities Proxy All
101104
102105startRefreshHelpGistTimer :: CommandTable -> Effect ()
0 commit comments