Config.hs 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. {- This file is part of funbot.
  2. -
  3. - Written in 2015 by fr33domlover <fr33domlover@rel4tion.org>.
  4. -
  5. - ♡ Copying is an act of love. Please copy, reuse and share.
  6. -
  7. - The author(s) have dedicated all copyright and related and neighboring
  8. - rights to this software to the public domain worldwide. This software is
  9. - distributed without any warranty.
  10. -
  11. - You should have received a copy of the CC0 Public Domain Dedication along
  12. - with this software. If not, see
  13. - <http://creativecommons.org/publicdomain/zero/1.0/>.
  14. -}
  15. module FunBot.Config
  16. ( stateSaveInterval
  17. , configuration
  18. , webListenerPort
  19. , feedErrorLogFile
  20. , feedVisitInterval
  21. , settingsFilename
  22. , memosFilename
  23. , userOptsFilename
  24. , nicksFilename
  25. , quoteDir
  26. )
  27. where
  28. import Data.Time.Interval (time)
  29. import Data.Time.Units
  30. import Network.IRC.Fun.Bot (defConfig)
  31. import Network.IRC.Fun.Bot.Types (Connection (..), Config (..))
  32. stateSaveInterval = 3 :: Second
  33. configuration = defConfig
  34. { cfgConnection = Connection
  35. { connServer = "irc.freenode.net"
  36. , connPort = 8000
  37. , connTls = False -- not supported yet
  38. , connNick = "fpbot"
  39. , connPassword = Just "___" -- ask fr33domlover or zPlus or koz_
  40. }
  41. , cfgChannels = ["#freepost-bot"]
  42. , cfgLogDir = "state/chanlogs"
  43. , cfgStateRepo = Just "state"
  44. , cfgStateFile = "state.json"
  45. , cfgSaveInterval = time stateSaveInterval
  46. , cfgBotEventLogFile = "state/bot.log"
  47. , cfgIrcErrorLogFile = Just "state/irc-error.log"
  48. , cfgMaxMsgChars = Just 400
  49. , cfgLagCheck = Just $ time (1 :: Minute)
  50. , cfgLagMax = time (3 :: Minute)
  51. }
  52. webListenerPort = 8999 :: Int
  53. feedErrorLogFile = "state/feed-error.log"
  54. feedVisitInterval = 5 :: Minute
  55. -- | If you set a repo path in the configuration above ('stateRepo' field),
  56. -- then this path is relative to that repo and the settings file will be
  57. -- commited to Git. Otherwise, this path is relative to the bot process working
  58. -- dir (or absolute), and Git won't be used.
  59. settingsFilename = "settings.json"
  60. -- | If you set a repo path in the configuration above ('stateRepo' field),
  61. -- then this path is relative to that repo and the memos file will be commited
  62. -- to Git. Otherwise, this path is relative to the bot process working dir (or
  63. -- absolute), and Git won't be used.
  64. memosFilename = "memos.json"
  65. -- | If you set a repo path in the configuration above ('stateRepo' field),
  66. -- then this path is relative to that repo and the user options file will be
  67. -- commited to Git. Otherwise, this path is relative to the bot process working
  68. -- dir (or absolute), and Git won't be used.
  69. userOptsFilename = "user-options.json"
  70. -- | If you set a repo path in the configuration above ('stateRepo' field),
  71. -- then this path is relative to that repo and the nicks file will be commited
  72. -- to Git. Otherwise, this path is relative to the bot process working dir (or
  73. -- absolute), and Git won't be used.
  74. nicksFilename = "nicks.json"
  75. -- | Directory in which to place channel quotes.
  76. quoteDir = "state/quotes"