+ # BotConfig for the core bot
+ BotConfig.register('server.name',
+ :default => "localhost", :requires_restart => true,
+ :desc => "What server should the bot connect to?",
+ :wizard => true)
+ BotConfig.register('server.port',
+ :default => 6667, :type => :integer, :requires_restart => true,
+ :desc => "What port should the bot connect to?",
+ :wizard => true)
+ BotConfig.register('server.password',
+ :default => false, :requires_restart => true, :type => :password,
+ :desc => "Password for connecting to this server (if required)",
+ :wizard => true)
+ BotConfig.register('server.bindhost',
+ :default => false, :requires_restart => true,
+ :desc => "Specific local host or IP for the bot to bind to (if required)",
+ :wizard => true)
+ BotConfig.register('server.reconnect_wait',
+ :default => 5, :type => :integer,
+ :desc => "Seconds to wait before attempting to reconnect, on disconnect")
+ BotConfig.register('irc.nick', :default => "rbot",
+ :desc => "IRC nickname the bot should attempt to use", :wizard => true,
+ :on_change => Proc.new{|v| sendq "NICK #{v}" })
+ BotConfig.register('irc.user', :default => "rbot",
+ :requires_restart => true,
+ :desc => "local user the bot should appear to be", :wizard => true)
+ BotConfig.register('irc.join_channels', :default => [], :type => :array,
+ :desc => "What channels the bot should always join at startup. List multiple channels using commas to separate. If a channel requires a password, use a space after the channel name. e.g: '#chan1, #chan2, #secretchan secritpass, #chan3'", :wizard => true)
+ BotConfig.register('core.save_every', :default => 60,
+ # TODO change timer via on_change proc
+ :desc => "How often the bot should persist all configuration to disk (in case of a server crash, for example")
+ BotConfig.register('server.sendq_delay', :default => 2.0, :type => :float,
+ :desc => "(flood prevention) the delay between sending messages to the server (in seconds)",
+ :on_change => Proc.new {|v| @socket.sendq_delay = v })
+ BotConfig.register('server.sendq_burst', :default => 4, :type => :integer,
+ :desc => "(flood prevention) max lines to burst to the server before throttling. Most ircd's allow bursts of up 5 lines, with non-burst limits of 512 bytes/2 seconds",
+ :on_change => Proc.new {|v| @socket.sendq_burst = v })
+