infinity-0.1.1: Config.hs
module Config (Server(..),Config(..),config) where
-- a datatype describing a particular IRC Server
data Server = Server {
address :: String, -- what server to connect to
portnum :: Int, -- what port
channels :: [String], -- what channels to enter
nickname :: String, -- bot nick
password :: String, -- bot password, can be empty
realname :: String, -- bot's real name
administrators :: [String] -- bot admins
}
-- the actual config datatype, defines global config
-- options as well as a list of servers to connect to
data Config = Config {
commandPrefixes :: String, -- command prefixes
servers :: [Server] -- list of servers to connect to
}
-- define your servers to connect to here
freenode = Server {
address = "irc.freenode.org",
portnum = 6667,
channels = ["#bot-battle-royale"],
nickname = "infinitybot",
password = "l0lic0nh4x",
realname = "time copper",
administrators = ["thoughtpolice"]
}
-- global configuration holding all options
config :: Config
config = Config {
commandPrefixes = "?!@",
servers = [freenode]
}