Commit 513a58c9 authored by Nicolas Lenz's avatar Nicolas Lenz

Help message

parent af297aff
......@@ -38,6 +38,12 @@ bot = BotApp {
botHandler = handleAction,
botJobs = []}
-- | Whether the message was sent in a private chat.
isPrivate :: Telegram.Message -> Bool
isPrivate msg = case Telegram.chatType $ Telegram.messageChat msg of
Telegram.ChatTypePrivate -> True
_ -> False
directMock :: UpdateParser Text
directMock = UpdateParser f where
f :: Telegram.Update -> Maybe Text
......@@ -49,7 +55,7 @@ directMock = UpdateParser f where
return "Only concatenations of up to 5 styles are allowed."
else case concatMaybeFunctions . map (\s -> lookup s styles) $ styleNames of
Just f -> return $ f (T.unwords $ tail $ T.words txt)
_ -> fail "Invalid mocking. See /help"
_ -> if isPrivate message then return "Invalid mocking. See /help." else fail "Invalid mocking."
replyToInline :: UpdateParser [(Text, Text, Text)]
replyToInline = UpdateParser f where
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment