6 require 'rbot/rbotconfig'
10 require 'rbot/rfc2812'
11 require 'rbot/keywords'
12 require 'rbot/ircsocket'
15 require 'rbot/plugins'
16 require 'rbot/channel'
17 require 'rbot/message'
18 require 'rbot/language'
20 require 'rbot/registry'
21 require 'rbot/httputil'
25 # Main bot class, which manages the various components, receives messages,
26 # handles them or passes them to plugins, and contains core functionality.
28 # the bot's current nickname
31 # the bot's IrcAuth data
34 # the bot's BotConfig data
37 # the botclass for this bot (determines configdir among other things)
40 # used to perform actions periodically (saves configuration once per minute
47 # bot's configured addressing prefixes
48 attr_reader :addressing_prefixes
50 # channel info for channels the bot is in
56 # bot's object registry, plugins get an interface to this for persistant
57 # storage (hash interface tied to a bdb file, plugins use Accessors to store
58 # and restore objects in their own namespaces.)
61 # bot's httputil help object, for fetching resources via http. Sets up
62 # proxies etc as defined by the bot configuration/environment
65 # create a new IrcBot with botclass +botclass+
66 def initialize(botclass, params = {})
67 # BotConfig for the core bot
68 BotConfig.register BotConfigStringValue.new('server.name',
69 :default => "localhost", :requires_restart => true,
70 :desc => "What server should the bot connect to?",
72 BotConfig.register BotConfigIntegerValue.new('server.port',
73 :default => 6667, :type => :integer, :requires_restart => true,
74 :desc => "What port should the bot connect to?",
75 :validate => Proc.new {|v| v > 0}, :wizard => true)
76 BotConfig.register BotConfigStringValue.new('server.password',
77 :default => false, :requires_restart => true,
78 :desc => "Password for connecting to this server (if required)",
80 BotConfig.register BotConfigStringValue.new('server.bindhost',
81 :default => false, :requires_restart => true,
82 :desc => "Specific local host or IP for the bot to bind to (if required)",
84 BotConfig.register BotConfigIntegerValue.new('server.reconnect_wait',
85 :default => 5, :validate => Proc.new{|v| v >= 0},
86 :desc => "Seconds to wait before attempting to reconnect, on disconnect")
87 BotConfig.register BotConfigStringValue.new('irc.nick', :default => "rbot",
88 :desc => "IRC nickname the bot should attempt to use", :wizard => true,
89 :on_change => Proc.new{|bot, v| bot.sendq "NICK #{v}" })
90 BotConfig.register BotConfigStringValue.new('irc.user', :default => "rbot",
91 :requires_restart => true,
92 :desc => "local user the bot should appear to be", :wizard => true)
93 BotConfig.register BotConfigArrayValue.new('irc.join_channels',
94 :default => [], :wizard => true,
95 :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'")
96 BotConfig.register BotConfigIntegerValue.new('core.save_every',
97 :default => 60, :validate => Proc.new{|v| v >= 0},
98 # TODO change timer via on_change proc
99 :desc => "How often the bot should persist all configuration to disk (in case of a server crash, for example")
100 BotConfig.register BotConfigFloatValue.new('server.sendq_delay',
101 :default => 2.0, :validate => Proc.new{|v| v >= 0},
102 :desc => "(flood prevention) the delay between sending messages to the server (in seconds)",
103 :on_change => Proc.new {|bot, v| bot.socket.sendq_delay = v })
104 BotConfig.register BotConfigIntegerValue.new('server.sendq_burst',
105 :default => 4, :validate => Proc.new{|v| v >= 0},
106 :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",
107 :on_change => Proc.new {|bot, v| bot.socket.sendq_burst = v })
109 @argv = params[:argv]
111 unless FileTest.directory? Config::datadir
112 puts "data directory '#{Config::datadir}' not found, did you install.rb?"
116 botclass = "/home/#{Etc.getlogin}/.rbot" unless botclass
117 @botclass = botclass.gsub(/\/$/, "")
119 unless FileTest.directory? botclass
120 puts "no #{botclass} directory found, creating from templates.."
121 if FileTest.exist? botclass
122 puts "Error: file #{botclass} exists but isn't a directory"
125 FileUtils.cp_r Config::datadir+'/templates', botclass
128 Dir.mkdir("#{botclass}/logs") unless File.exist?("#{botclass}/logs")
130 @startup_time = Time.new
131 @config = BotConfig.new(self)
132 @timer = Timer::Timer.new(1.0) # only need per-second granularity
133 @registry = BotRegistry.new self
134 @timer.add(@config['core.save_every']) { save } if @config['core.save_every']
138 @httputil = Utils::HttpUtil.new(self)
139 @lang = Language::Language.new(@config['core.language'])
140 @keywords = Keywords.new(self)
141 @auth = IrcAuth.new(self)
143 Dir.mkdir("#{botclass}/plugins") unless File.exist?("#{botclass}/plugins")
144 @plugins = Plugins::Plugins.new(self, ["#{botclass}/plugins"])
146 @socket = IrcSocket.new(@config['server.name'], @config['server.port'], @config['server.bindhost'], @config['server.sendq_delay'], @config['server.sendq_burst'])
147 @nick = @config['irc.nick']
148 if @config['core.address_prefix']
149 @addressing_prefixes = @config['core.address_prefix'].split(" ")
151 @addressing_prefixes = Array.new
154 @client = IrcClient.new
155 @client["PRIVMSG"] = proc { |data|
156 message = PrivMessage.new(self, data["SOURCE"], data["TARGET"], data["MESSAGE"])
159 @client["NOTICE"] = proc { |data|
160 message = NoticeMessage.new(self, data["SOURCE"], data["TARGET"], data["MESSAGE"])
161 # pass it off to plugins that want to hear everything
162 @plugins.delegate "listen", message
164 @client["MOTD"] = proc { |data|
165 data['MOTD'].each_line { |line|
166 log "MOTD: #{line}", "server"
169 @client["NICKTAKEN"] = proc { |data|
172 @client["BADNICK"] = proc {|data|
173 puts "WARNING, bad nick (#{data['NICK']})"
175 @client["PING"] = proc {|data|
176 # (jump the queue for pongs)
177 @socket.puts "PONG #{data['PINGID']}"
179 @client["NICK"] = proc {|data|
180 sourcenick = data["SOURCENICK"]
182 m = NickMessage.new(self, data["SOURCE"], data["SOURCENICK"], data["NICK"])
183 if(sourcenick == @nick)
186 @channels.each {|k,v|
187 if(v.users.has_key?(sourcenick))
188 log "@ #{sourcenick} is now known as #{nick}", k
189 v.users[nick] = v.users[sourcenick]
190 v.users.delete(sourcenick)
193 @plugins.delegate("listen", m)
194 @plugins.delegate("nick", m)
196 @client["QUIT"] = proc {|data|
197 source = data["SOURCE"]
198 sourcenick = data["SOURCENICK"]
199 sourceurl = data["SOURCEADDRESS"]
200 message = data["MESSAGE"]
201 m = QuitMessage.new(self, data["SOURCE"], data["SOURCENICK"], data["MESSAGE"])
202 if(data["SOURCENICK"] =~ /#{@nick}/i)
204 @channels.each {|k,v|
205 if(v.users.has_key?(sourcenick))
206 log "@ Quit: #{sourcenick}: #{message}", k
207 v.users.delete(sourcenick)
211 @plugins.delegate("listen", m)
212 @plugins.delegate("quit", m)
214 @client["MODE"] = proc {|data|
215 source = data["SOURCE"]
216 sourcenick = data["SOURCENICK"]
217 sourceurl = data["SOURCEADDRESS"]
218 channel = data["CHANNEL"]
219 targets = data["TARGETS"]
220 modestring = data["MODESTRING"]
221 log "@ Mode #{modestring} #{targets} by #{sourcenick}", channel
223 @client["WELCOME"] = proc {|data|
224 log "joined server #{data['SOURCE']} as #{data['NICK']}", "server"
225 debug "I think my nick is #{@nick}, server thinks #{data['NICK']}"
226 if data['NICK'] && data['NICK'].length > 0
229 if(@config['irc.quser'])
230 # TODO move this to a plugin
231 debug "authing with Q using #{@config['quakenet.user']} #{@config['quakenet.auth']}"
232 @socket.puts "PRIVMSG Q@CServe.quakenet.org :auth #{@config['quakenet.user']} #{@config['quakenet.auth']}"
235 @config['irc.join_channels'].each {|c|
236 debug "autojoining channel #{c}"
237 if(c =~ /^(\S+)\s+(\S+)$/i)
244 @client["JOIN"] = proc {|data|
245 m = JoinMessage.new(self, data["SOURCE"], data["CHANNEL"], data["MESSAGE"])
248 @client["PART"] = proc {|data|
249 m = PartMessage.new(self, data["SOURCE"], data["CHANNEL"], data["MESSAGE"])
252 @client["KICK"] = proc {|data|
253 m = KickMessage.new(self, data["SOURCE"], data["TARGET"],data["CHANNEL"],data["MESSAGE"])
256 @client["INVITE"] = proc {|data|
257 if(data["TARGET"] =~ /^#{@nick}$/i)
258 join data["CHANNEL"] if (@auth.allow?("join", data["SOURCE"], data["SOURCENICK"]))
261 @client["CHANGETOPIC"] = proc {|data|
262 channel = data["CHANNEL"]
263 sourcenick = data["SOURCENICK"]
264 topic = data["TOPIC"]
265 timestamp = data["UNIXTIME"] || Time.now.to_i
266 if(sourcenick == @nick)
267 log "@ I set topic \"#{topic}\"", channel
269 log "@ #{sourcenick} set topic \"#{topic}\"", channel
271 m = TopicMessage.new(self, data["SOURCE"], data["CHANNEL"], timestamp, data["TOPIC"])
274 @plugins.delegate("listen", m)
275 @plugins.delegate("topic", m)
277 @client["TOPIC"] = @client["TOPICINFO"] = proc {|data|
278 channel = data["CHANNEL"]
279 m = TopicMessage.new(self, data["SOURCE"], data["CHANNEL"], data["UNIXTIME"], data["TOPIC"])
282 @client["NAMES"] = proc {|data|
283 channel = data["CHANNEL"]
284 users = data["USERS"]
285 unless(@channels[channel])
286 puts "bug: got names for channel '#{channel}' I didn't think I was in\n"
289 @channels[channel].users.clear
291 @channels[channel].users[u[0].sub(/^[@&~+]/, '')] = ["mode", u[1]]
294 @client["UNKNOWN"] = proc {|data|
295 debug "UNKNOWN: #{data['SERVERSTRING']}"
299 # connect the bot to IRC
301 trap("SIGTERM") { quit }
302 trap("SIGHUP") { quit }
303 trap("SIGINT") { quit }
307 raise "failed to connect to IRC server at #{@config['server.name']} #{@config['server.port']}: " + e
309 @socket.puts "PASS " + @config['server.password'] if @config['server.password']
310 @socket.puts "NICK #{@nick}\nUSER #{@config['irc.user']} 4 #{@config['server.name']} :Ruby bot. (c) Tom Gilbert"
313 # begin event handling loop
322 break unless reply = @socket.gets
323 @client.process reply
326 rescue TimeoutError, SocketError => e
327 puts "network exception: connection closed: #{e}"
328 puts e.backtrace.join("\n")
329 @socket.close # now we reconnect
330 rescue => e # TODO be selective, only grab Network errors
331 puts "unexpected exception: connection closed: #{e}"
332 puts e.backtrace.join("\n")
340 puts "waiting to reconnect"
341 sleep @config['server.reconnect_wait']
345 # type:: message type
346 # where:: message target
347 # message:: message text
348 # send message +message+ of type +type+ to target +where+
349 # Type can be PRIVMSG, NOTICE, etc, but those you should really use the
350 # relevant say() or notice() methods. This one should be used for IRCd
351 # extensions you want to use in modules.
352 def sendmsg(type, where, message)
353 # limit it 440 chars + CRLF.. so we have to split long lines
354 left = 440 - type.length - where.length - 3
356 if(left >= message.length)
357 sendq("#{type} #{where} :#{message}")
358 log_sent(type, where, message)
361 line = message.slice!(0, left)
362 lastspace = line.rindex(/\s+/)
364 message = line.slice!(lastspace, line.length) + message
365 message.gsub!(/^\s+/, "")
367 sendq("#{type} #{where} :#{line}")
368 log_sent(type, where, line)
369 end while(message.length > 0)
372 def sendq(message="")
374 @socket.queue(message)
377 # send a notice message to channel/nick +where+
378 def notice(where, message)
379 message.each_line { |line|
381 next unless(line.length > 0)
382 sendmsg("NOTICE", where, line)
386 # say something (PRIVMSG) to channel/nick +where+
387 def say(where, message)
388 message.to_s.gsub(/[\r\n]+/, "\n").each_line { |line|
390 next unless(line.length > 0)
391 unless((where =~ /^#/) && (@channels.has_key?(where) && @channels[where].quiet))
392 sendmsg("PRIVMSG", where, line)
397 # perform a CTCP action with message +message+ to channel/nick +where+
398 def action(where, message)
399 sendq("PRIVMSG #{where} :\001ACTION #{message}\001")
401 log "* #{@nick} #{message}", where
402 elsif (where =~ /^(\S*)!.*$/)
403 log "* #{@nick}[#{where}] #{message}", $1
405 log "* #{@nick}[#{where}] #{message}", where
409 # quick way to say "okay" (or equivalent) to +where+
411 say where, @lang.get("okay")
414 # log message +message+ to a file determined by +where+. +where+ can be a
415 # channel name, or a nick for private message logging
416 def log(message, where="server")
418 stamp = Time.now.strftime("%Y/%m/%d %H:%M:%S")
419 unless(@logs.has_key?(where))
420 @logs[where] = File.new("#{@botclass}/logs/#{where}", "a")
421 @logs[where].sync = true
423 @logs[where].puts "[#{stamp}] #{message}"
424 #debug "[#{stamp}] <#{where}> #{message}"
427 # set topic of channel +where+ to +topic+
428 def topic(where, topic)
429 sendq "TOPIC #{where} :#{topic}"
432 def shutdown(message = nil)
433 trap("SIGTERM", "DEFAULT")
434 trap("SIGHUP", "DEFAULT")
435 trap("SIGINT", "DEFAULT")
436 message = @lang.get("quit") if (message.nil? || message.empty?)
440 @channels.each_value {|v|
441 log "@ quit (#{message})", v.name
443 @socket.puts "QUIT :#{message}"
447 puts "rbot quit (#{message})"
450 # message:: optional IRC quit message
451 # quit IRC, shutdown the bot
452 def quit(message=nil)
457 # totally shutdown and respawn the bot
459 shutdown("restarting, back in #{@config['server.reconnect_wait']}...")
460 sleep @config['server.reconnect_wait']
465 # call the save method for bot's config, keywords, auth and all plugins
474 # call the rescan method for the bot's lang, keywords and all plugins
481 # channel:: channel to join
482 # key:: optional channel key if channel is +s
484 def join(channel, key=nil)
486 sendq "JOIN #{channel} :#{key}"
488 sendq "JOIN #{channel}"
493 def part(channel, message="")
494 sendq "PART #{channel} :#{message}"
497 # attempt to change bot's nick to +name+
499 # if rbot is already taken, this happens:
500 # <giblet> rbot_, nick rbot
501 # --- rbot_ is now known as rbot__
502 # he should of course just keep his existing nick and report the error :P
508 def mode(channel, mode, target)
509 sendq "MODE #{channel} #{mode} #{target}"
512 # m:: message asking for help
513 # topic:: optional topic help is requested for
514 # respond to online help requests
516 topic = nil if topic == ""
519 helpstr = "help topics: core, auth, keywords"
520 helpstr += @plugins.helptopics
521 helpstr += " (help <topic> for more info)"
524 when /^core\s+(.+)$/i
525 helpstr = corehelp $1
528 when /^auth\s+(.+)$/i
529 helpstr = @auth.help $1
531 helpstr = @keywords.help
532 when /^keywords\s+(.+)$/i
533 helpstr = @keywords.help $1
535 unless(helpstr = @plugins.help(topic))
536 helpstr = "no help for topic #{topic}"
543 secs_up = Time.new - @startup_time
544 uptime = Utils.secs_to_string secs_up
545 return "Uptime #{uptime}, #{@plugins.length} plugins active, #{@registry.length} items stored in registry, #{@socket.lines_sent} lines sent, #{@socket.lines_received} received."
551 # handle help requests for "core" topics
552 def corehelp(topic="")
555 return "quit [<message>] => quit IRC with message <message>"
557 return "restart => completely stop and restart the bot (including reconnect)"
559 return "join <channel> [<key>] => join channel <channel> with secret key <key> if specified. #{@nick} also responds to invites if you have the required access level"
561 return "part <channel> => part channel <channel>"
563 return "hide => part all channels"
565 return "save => save current dynamic data and configuration"
567 return "rescan => reload modules and static facts"
569 return "nick <nick> => attempt to change nick to <nick>"
571 return "say <channel>|<nick> <message> => say <message> to <channel> or in private message to <nick>"
573 return "action <channel>|<nick> <message> => does a /me <message> to <channel> or in private message to <nick>"
575 return "topic <channel> <message> => set topic of <channel> to <message>"
577 return "quiet [in here|<channel>] => with no arguments, stop speaking in all channels, if \"in here\", stop speaking in this channel, or stop speaking in <channel>"
579 return "talk [in here|<channel>] => with no arguments, resume speaking in all channels, if \"in here\", resume speaking in this channel, or resume speaking in <channel>"
581 return "version => describes software version"
583 return "botsnack => reward #{@nick} for being good"
585 return "hello|hi|hey|yo [#{@nick}] => greet the bot"
587 return "Core help topics: quit, restart, config, join, part, hide, save, rescan, nick, say, action, topic, quiet, talk, version, botsnack, hello"
591 # handle incoming IRC PRIVMSG +m+
596 log "* [#{m.sourcenick}(#{m.sourceaddress})] #{m.message}", m.sourcenick
598 log "* #{m.sourcenick} #{m.message}", m.target
602 log "<#{m.sourcenick}> #{m.message}", m.target
604 log "[#{m.sourcenick}(#{m.sourceaddress})] #{m.message}", m.sourcenick
608 # pass it off to plugins that want to hear everything
609 @plugins.delegate "listen", m
611 if(m.private? && m.message =~ /^\001PING\s+(.+)\001/)
612 notice m.sourcenick, "\001PING #$1\001"
613 log "@ #{m.sourcenick} pinged me"
619 when (/^join\s+(\S+)\s+(\S+)$/i)
620 join $1, $2 if(@auth.allow?("join", m.source, m.replyto))
621 when (/^join\s+(\S+)$/i)
622 join $1 if(@auth.allow?("join", m.source, m.replyto))
624 part m.target if(m.public? && @auth.allow?("join", m.source, m.replyto))
625 when (/^part\s+(\S+)$/i)
626 part $1 if(@auth.allow?("join", m.source, m.replyto))
627 when (/^quit(?:\s+(.*))?$/i)
628 quit $1 if(@auth.allow?("quit", m.source, m.replyto))
630 restart if(@auth.allow?("quit", m.source, m.replyto))
632 join 0 if(@auth.allow?("join", m.source, m.replyto))
634 if(@auth.allow?("config", m.source, m.replyto))
638 when (/^nick\s+(\S+)$/i)
639 nickchg($1) if(@auth.allow?("nick", m.source, m.replyto))
640 when (/^say\s+(\S+)\s+(.*)$/i)
641 say $1, $2 if(@auth.allow?("say", m.source, m.replyto))
642 when (/^action\s+(\S+)\s+(.*)$/i)
643 action $1, $2 if(@auth.allow?("say", m.source, m.replyto))
644 when (/^topic\s+(\S+)\s+(.*)$/i)
645 topic $1, $2 if(@auth.allow?("topic", m.source, m.replyto))
646 when (/^mode\s+(\S+)\s+(\S+)\s+(.*)$/i)
647 mode $1, $2, $3 if(@auth.allow?("mode", m.source, m.replyto))
649 say m.replyto, "pong"
651 if(@auth.allow?("config", m.source, m.replyto))
656 if(auth.allow?("talk", m.source, m.replyto))
658 @channels.each_value {|c| c.quiet = true }
660 when (/^quiet in (\S+)$/i)
662 if(auth.allow?("talk", m.source, m.replyto))
664 where.gsub!(/^here$/, m.target) if m.public?
665 @channels[where].quiet = true if(@channels.has_key?(where))
668 if(auth.allow?("talk", m.source, m.replyto))
669 @channels.each_value {|c| c.quiet = false }
672 when (/^talk in (\S+)$/i)
674 if(auth.allow?("talk", m.source, m.replyto))
675 where.gsub!(/^here$/, m.target) if m.public?
676 @channels[where].quiet = false if(@channels.has_key?(where))
679 when (/^status\??$/i)
680 m.reply status if auth.allow?("status", m.source, m.replyto)
681 when (/^registry stats$/i)
682 if auth.allow?("config", m.source, m.replyto)
683 m.reply @registry.stat.inspect
685 when (/^(help\s+)?config(\s+|$)/)
687 when (/^(version)|(introduce yourself)$/i)
688 say m.replyto, "I'm a v. #{$version} rubybot, (c) Tom Gilbert - http://linuxbrit.co.uk/rbot/"
689 when (/^help(?:\s+(.*))?$/i)
690 say m.replyto, help($1)
691 #TODO move these to a "chatback" plugin
692 when (/^(botsnack|ciggie)$/i)
693 say m.replyto, @lang.get("thanks_X") % m.sourcenick if(m.public?)
694 say m.replyto, @lang.get("thanks") if(m.private?)
695 when (/^(hello|howdy|hola|salut|bonjour|sup|niihau|hey|hi(\W|$)|yo(\W|$)).*/i)
696 say m.replyto, @lang.get("hello_X") % m.sourcenick if(m.public?)
697 say m.replyto, @lang.get("hello") if(m.private?)
702 # stuff to handle when not addressed
704 when (/^\s*(hello|howdy|hola|salut|bonjour|sup|niihau|hey|hi(\W|$)|yo(\W|$))[\s,-.]+#{@nick}$/i)
705 say m.replyto, @lang.get("hello_X") % m.sourcenick
706 when (/^#{@nick}!*$/)
707 say m.replyto, @lang.get("hello_X") % m.sourcenick
714 # log a message. Internal use only.
715 def log_sent(type, where, message)
719 log "-=#{@nick}=- #{message}", where
720 elsif (where =~ /(\S*)!.*/)
721 log "[-=#{where}=-] #{message}", $1
723 log "[-=#{where}=-] #{message}"
727 log "<#{@nick}> #{message}", where
728 elsif (where =~ /^(\S*)!.*$/)
729 log "[msg(#{where})] #{message}", $1
731 log "[msg(#{where})] #{message}", where
737 @channels[m.channel] = IRCChannel.new(m.channel) unless(@channels.has_key?(m.channel))
739 debug "joined channel #{m.channel}"
740 log "@ Joined channel #{m.channel}", m.channel
742 log "@ #{m.sourcenick} joined channel #{m.channel}", m.channel
743 @channels[m.channel].users[m.sourcenick] = Hash.new
744 @channels[m.channel].users[m.sourcenick]["mode"] = ""
747 @plugins.delegate("listen", m)
748 @plugins.delegate("join", m)
753 debug "left channel #{m.channel}"
754 log "@ Left channel #{m.channel} (#{m.message})", m.channel
755 @channels.delete(m.channel)
757 log "@ #{m.sourcenick} left channel #{m.channel} (#{m.message})", m.channel
758 @channels[m.channel].users.delete(m.sourcenick)
761 # delegate to plugins
762 @plugins.delegate("listen", m)
763 @plugins.delegate("part", m)
766 # respond to being kicked from a channel
769 debug "kicked from channel #{m.channel}"
770 @channels.delete(m.channel)
771 log "@ You have been kicked from #{m.channel} by #{m.sourcenick} (#{m.message})", m.channel
773 @channels[m.channel].users.delete(m.sourcenick)
774 log "@ #{m.target} has been kicked from #{m.channel} by #{m.sourcenick} (#{m.message})", m.channel
777 @plugins.delegate("listen", m)
778 @plugins.delegate("kick", m)
782 @channels[m.channel] = IRCChannel.new(m.channel) unless(@channels.has_key?(m.channel))
783 @channels[m.channel].topic = m.topic if !m.topic.nil?
784 @channels[m.channel].topic.timestamp = m.timestamp if !m.timestamp.nil?
785 @channels[m.channel].topic.by = m.source if !m.source.nil?
787 debug "topic of channel #{m.channel} is now #{@channels[m.channel].topic}"
790 # delegate a privmsg to auth, keyword or plugin handlers
791 def delegate_privmsg(message)
792 [@auth, @plugins, @keywords].each {|m|
793 break if m.privmsg(message)