Skip to content
tbuehlmann edited this page Apr 26, 2013 · 6 revisions

Configuration

How to configure

require 'vetinari'

bot = Vetinari::Bot.new do |config|
  config.option = 'value'
end

Configuration Options

Configuration Type Default Explanation
server String 'chat.freenode.org' The server, the Bot will try to join.
port Fixum 6667 Port for the server.
nick String "Vetinari#{rand(10_000)}" Bot's nickname.
username String 'Vetinari' Bot's username.
real_name String 'Havelock Vetinari' Bot's real name.
password String false IRC Server password.
verbose Boolean true If true, logger activity is put into the console.
logging Boolean false If true, logger activity is written to a log file (default: app_file/logs/log.log).
logger Logger nil If logging is true, logger sets the logger that shall be used. Example: Rails.logger.
reconnect Boolean true If true, the Bot will try to reconnect upon unintended disconnect.
reconnect_interval Fixnum 30 If reconnect_interval is true, the Bot will wait reconnect_interval seconds before trying to reconnect.
hide_ping_pongs Boolean true If hide_ping_pongs is true, all PING PONG events are hid from the verbose console logger and the actual logger.
rejoin_after_kick Boolean false If rejoin_after_kick is true, the Bot will try to rejoin a channel after being kicked from it.
dcc.ports Array [] Ports that shall be used for outgoing DCC file transfers.

Accessing Configuration

The Configuration is a simple OpenStruct object, you can read and write options through bot.config. Though it's not possible to change behaviour on runtime.

Clone this wiki locally