packages feed

infinity-0.3: Plugins/Greet.hs

module Greet where
import API

plugin :: InfinityPlugin
plugin = InfinityPlugin {
  name        = "Greet",
  commands    = [("hi","says 'hello world!'")
                ,("bye","says 'goodbye cruel world!'")],
  action      = greet
}

greet :: PLUGIN
greet user chan command str = do
  case command of
    "hi"  -> retJust "hello world!"
    "bye" -> retJust "goodbye cruel world!"