demobot/src/Extension/Hello.hs

15 lines
429 B
Haskell

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