mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2025-06-28 20:29:53 +00:00
apps: update chat bots, readme (#1928)
* apps: update chat bots, readme * CLI readme * broadcast bot * delete messages from non-publishers, better replies, support forwarding low-res images and links * typo Co-authored-by: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com> * change --------- Co-authored-by: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com>
This commit is contained in:
parent
6f68840b3a
commit
a0351d6f99
16 changed files with 332 additions and 17 deletions
|
@ -14,11 +14,14 @@ main :: IO ()
|
|||
main = do
|
||||
opts <- welcomeGetOpts
|
||||
simplexChatCore terminalChatConfig opts Nothing $
|
||||
chatBotRepl "Hello! I am a simple squaring bot - if you send me a number, I will calculate its square" $ \msg ->
|
||||
case readMaybe msg :: Maybe Integer of
|
||||
chatBotRepl welcomeMessage $ \_contact msg ->
|
||||
pure $ case readMaybe msg :: Maybe Integer of
|
||||
Just n -> msg <> " * " <> msg <> " = " <> show (n * n)
|
||||
_ -> "\"" <> msg <> "\" is not a number"
|
||||
|
||||
welcomeMessage :: String
|
||||
welcomeMessage = "Hello! I am a simple squaring bot.\nIf you send me a number, I will calculate its square"
|
||||
|
||||
welcomeGetOpts :: IO ChatOpts
|
||||
welcomeGetOpts = do
|
||||
appDir <- getAppUserDataDirectory "simplex"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue