demobot/src/Extension/Hello.hs

15 lines
429 B
Haskell
Raw Permalink Normal View History

2018-12-23 23:52:19 +02:00
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
2018-12-23 23:23:14 +02:00
module Extension.Hello where
2018-12-23 23:52:19 +02:00
import Bot.DSL
import Bot.Extension
import qualified Data.Text as T
2018-12-23 23:23:14 +02:00
extension :: Extension ()
extension = Extension{..}
where
name = "hello world"
act Request{..} | "hello" `T.isPrefixOf` content = return $ Just $ Response "Hello to you" ()
| otherwise = return Nothing