Commit 6b4798d8 authored by Nicolas Lenz's avatar Nicolas Lenz

Bump mock version and improve help message.

parent d9a97b9e
...@@ -13,6 +13,7 @@ import Telegram.Bot.Simple.Debug ...@@ -13,6 +13,7 @@ import Telegram.Bot.Simple.Debug
import Telegram.Bot.Simple.UpdateParser import Telegram.Bot.Simple.UpdateParser
import Control.Monad.Reader import Control.Monad.Reader
import Mock (styles) import Mock (styles)
import Mock.Help (styleHelp)
-- | Bot conversation state model. -- | Bot conversation state model.
...@@ -65,7 +66,7 @@ handleAction (Reply message) model = model <# do ...@@ -65,7 +66,7 @@ handleAction (Reply message) model = model <# do
replyText message replyText message
pure NoAction pure NoAction
handleAction SendHelp model = model <# do handleAction SendHelp model = model <# do
reply $ (toReplyMessage help) {replyMessageParseMode = Just Telegram.Markdown} reply $ (toReplyMessage help) {replyMessageParseMode = Just Telegram.Markdown, replyMessageDisableWebPagePreview = Just True}
pure NoAction pure NoAction
-- | Run bot with a given 'Telegram.Token'. -- | Run bot with a given 'Telegram.Token'.
...@@ -81,12 +82,18 @@ main = T.readFile "config/token" >>= run . T.dropWhileEnd isSpace ...@@ -81,12 +82,18 @@ main = T.readFile "config/token" >>= run . T.dropWhileEnd isSpace
-- |Help string. -- |Help string.
help :: T.Text help :: T.Text
help = T.unlines [ help = T.unlines [
"*Mock - a bot to transform text.*", "*Mock*",
"A Great BoT tO TRANsFoRM TEXt, wRiTten iN HaSKeLL.",
"By Nicolas Lenz. [Free and open source under the WTFPL.](https://git.eisfunke.com/software/mock-telegram-bot)",
"", "",
"*Usage:* \\[STYLE] \\[TEXT]", "*Usage:* \\[STYLE] \\[TEXT]",
"*Styles:* " `T.append` (T.intercalate ", " $ map fst styles),
"",
"*Example:* `random Cool Text`", "*Example:* `random Cool Text`",
"", "",
"Multiple styles can be concatenated with \'|\'s.", "Multiple styles can be concatenated with \'|\'s.",
"*Example:* `random|double Cool Text`"] "*Example:* `random|double Cool Text`",
"",
"*Available Styles:*",
T.intercalate "\n" styleHelps] where
styleHelps = map
(\(name, _) -> T.concat [" *", name, "*: ", styleHelp name])
styles
resolver: lts-12.19 resolver: lts-12.24
packages: packages:
- . - .
extra-deps: extra-deps:
- git: https://git.eisfunke.com/software/mock - git: https://git.eisfunke.com/software/mock
commit: 3ef77978a1760032f7527e201d43f7a019c573bd commit: 0ee2b62b984d44fa5199d4d94c81fb6cf271ba3d
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