processInboxCommandHandlers ::
  Maybe [InboxHandlerCommandSpec] ->
  ([ConfigError], CustomHandlers)
processInboxCommandHandlers maybeCmdSpecs =
  let
    cmdSpecs :: [InboxHandlerCommandSpec]
    cmdSpecs = fromMaybe [] maybeCmdSpecs

    hasRightNumChars spec = (List.length $ T.unpack $ (cmdKey spec) ) > 0

    (rightNumCharsCmds,
     wrongNumCharsCmds) = List.partition hasRightNumChars cmdSpecs

    errors =
      (ErrorCmdHandlerKeyWrongNumChars <$> wrongNumCharsCmds)

    toPair spec = (cmdKey spec, spec)

    successes = toPair <$> rightNumCharsCmds
  in
    (errors, M.fromList successes)
processInboxCommandHandlers ::
  Maybe [InboxHandlerCommandSpec] ->
  ([ConfigError], CustomHandlers)
processInboxCommandHandlers maybeCmdSpecs =
  let
    cmdSpecs :: [InboxHandlerCommandSpec]
    cmdSpecs = fromMaybe [] maybeCmdSpecs

    hasRightNumChars spec = (List.length $ T.unpack $ (cmdKey spec) ) > 0

    (rightNumCharsCmds,
     wrongNumCharsCmds) = List.partition hasRightNumChars cmdSpecs

    errors =
      (ErrorCmdHandlerKeyWrongNumChars <$> wrongNumCharsCmds)

    toPair spec = (cmdKey spec, spec)

    successes = toPair <$> rightNumCharsCmds
  in
    (errors, M.fromList successes)
processInboxCommandHandlers maybeCmdSpecs =
  let
    cmdSpecs :: [InboxHandlerCommandSpec]
    cmdSpecs = fromMaybe [] maybeCmdSpecs

    hasRightNumChars spec = (List.length $ T.unpack $ (cmdKey spec) ) > 0

    (rightNumCharsCmds,
     wrongNumCharsCmds) = List.partition hasRightNumChars cmdSpecs

    errors =
      (ErrorCmdHandlerKeyWrongNumChars <$> wrongNumCharsCmds)

    toPair spec = (cmdKey spec, spec)

    successes = toPair <$> rightNumCharsCmds
  in
    (errors, M.fromList successes)