demobot/src/Extension/Hello.hs

16 lines
436 B
Haskell
Raw Normal View History

2018-12-23 23:23:14 +02:00
{-# Language RecordWildCards #-}
{-# Language OverloadedStrings #-}
{-# Language ScopedTypeVariables #-}
module Extension.Hello where
import Bot.Extension
import Bot.DSL
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