* fix address_prefix, broken in 0.9.9, reported by ruskie.
+Sun Aug 07 15:11:07 BST 2005 Tom Gilbert <tom@linuxbrit.co.uk>
+
+ * fix address_prefix, broken in 0.9.9, reported by ruskie.
+
+Sat Aug 06 00:54:34 BST 2005 Tom Gilbert <tom@linuxbrit.co.uk>
+
+ * Released 0.9.9
+
Fri Aug 05 23:55:20 BST 2005 Tom Gilbert <tom@linuxbrit.co.uk>
* few more tweaks preparing to release 0.9.9
require 'rake'
require 'rake/gempackagetask'
-task :default => [:package]
+task :default => [:repackage]
spec = Gem::Specification.new do |s|
s.name = 'rbot'
@socket = IrcSocket.new(@config['server.name'], @config['server.port'], @config['server.bindhost'], @config['server.sendq_delay'], @config['server.sendq_burst'])
@nick = @config['irc.nick']
- if @config['core.address_prefix']
- @addressing_prefixes = @config['core.address_prefix'].split(" ")
- else
- @addressing_prefixes = Array.new
- end
@client = IrcClient.new
@client[:privmsg] = proc { |data|
else
# stuff to handle when not addressed
case m.message
- when (/^\s*(hello|howdy|hola|salut|bonjour|sup|niihau|hey|hi(\W|$)|yo(\W|$))[\s,-.]+#{@nick}$/i)
+ when (/^\s*(hello|howdy|hola|salut|bonjour|sup|niihau|hey|hi|yo(\W|$))[\s,-.]+#{@nick}$/i)
say m.replyto, @lang.get("hello_X") % m.sourcenick
when (/^#{@nick}!*$/)
say m.replyto, @lang.get("hello_X") % m.sourcenick
module Irc
+ BotConfig.register BotConfigArrayValue.new('core.address_prefix',
+ :default => [], :wizard => true,
+ :desc => "what non nick-matching prefixes should the bot respond to as if addressed (e.g !, so that '!foo' is treated like 'rbot: foo')"
+ )
# base user message class, all user messages derive from this
# (a user message is defined as having a source hostmask, a target
# check for option extra addressing prefixes, e.g "|search foo", or
# "!version" - first match wins
- bot.addressing_prefixes.each {|mprefix|
+ bot.config['core.address_prefix'].each {|mprefix|
if @message.gsub!(/^#{Regexp.escape(mprefix)}\s*/, "")
@address = true
break