aboutsummaryrefslogtreecommitdiffstats
path: root/src/Plugin/Base.hs
blob: ac67e712ea93692390ebdff1ec0bfa82c1d5ff68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
module Plugin.Base
    ( PluginAction

    , Plugin(..)
    ) where

import qualified Data.Text as T

import Database.SQLite.Simple

import Message

type PluginAction = Message -> IO (Either T.Text T.Text)

data Plugin = Plugin
    { matchRegex  :: String
    , perform     :: PluginAction
    , command     :: T.Text
    , description :: T.Text
    }

instance Show Plugin where
    show (Plugin r _ _ _) = "matchRegex = " ++ r