An IRC bot for learning, fun and collaboration in the Freepost community.

[[ 🗃 ^VvM9v funbot ]] :: [📥 Inbox] [📤 Outbox] [🐤 Followers] [🤝 Collaborators] [🛠 Commits]

Clone

HTTPS: git clone https://vervis.peers.community/repos/VvM9v

SSH: git clone USERNAME@vervis.peers.community:VvM9v

Branches

Tags

master :: src / FunBot /

Config.hs

{- This file is part of funbot.
 -
 - Written in 2015, 2016 by fr33domlover <fr33domlover@riseup.net>.
 -
 - ♡ Copying is an act of love. Please copy, reuse and share.
 -
 - The author(s) have dedicated all copyright and related and neighboring
 - rights to this software to the public domain worldwide. This software is
 - distributed without any warranty.
 -
 - You should have received a copy of the CC0 Public Domain Dedication along
 - with this software. If not, see
 - <http://creativecommons.org/publicdomain/zero/1.0/>.
 -}

{-# LANGUAGE OverloadedStrings #-}

module FunBot.Config
    ( stateSaveInterval
    , configuration
    , webListenerPort
    , webErrorLogFile
    , feedErrorLogFile
    , feedVisitInterval
    , feedDebug
    , settingsFilename
    , memosFilename
    , userOptsFilename
    , nicksFilename
    , quoteDir
    , introInfo
    , welcomeDelay
    )
where

import Data.Default.Class (def)
import Data.Text (Text)
import Data.Time.Interval (time)
import Data.Time.Units
import Network.IRC.Fun.Bot.Types
import Network.IRC.Fun.Client.IO
import Network.IRC.Fun.Types.Base

stateSaveInterval = 3 :: Second

configuration = def
    { cfgConnection = def
        { connServer   = Hostname "irc.freenode.net"
        , connPort     = PortNumber 6667
        , connTls      = False
        , connNickname = Nickname "bot_test_joe"
        , connPassword = Nothing
        }
    , cfgChannels        = map Channel ["#freepost-bot-test"]
    , cfgLogDir          = "state/chanlogs"
    , cfgStateRepo       = Nothing
    , cfgStateFile       = "state/state.json"
    , cfgSaveInterval    = time stateSaveInterval
    , cfgMaxMsgChars     = Just 400
    }

webListenerPort = 8998 :: Int

webErrorLogFile = "state/web-error.log"

feedErrorLogFile = "state/feed-error.log"

feedVisitInterval = 5 :: Minute

feedDebug = False

-- | If you set a repo path in the configuration above ('stateRepo' field),
-- then this path is relative to that repo and the settings file will be
-- commited to Git. Otherwise, this path is relative to the bot process working
-- dir (or absolute), and Git won't be used.
settingsFilename = "state/settings.json"

-- | Same idea, for memos.
memosFilename = "state/memos.json"

-- | Same idea, for user options.
userOptsFilename = "state/user-options.json"

-- | Same idea, for known nickname lists.
nicksFilename = "state/nicks.json"

-- | Directory in which to place channel quotes.
quoteDir = "state/quotes"

-- | Introductory information for use by the @!intro@ command.
introInfo :: Text
introInfo =
    "Hello. I’m an instance of FunBot, written in Haskell. No other info, \
    \sorry. Ask the bot maintainer to write something here."

-- | How much silent time the bot waits before it considers a channel quiet and
-- welcomes a new user. This is in seconds.
welcomeDelay = 60 :: Int
[See repo JSON]