X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=lib%2Frbot%2Fircbot.rb;h=432b61c40d4180653331bb5f5152d7ad098203e3;hb=a72327f672f148f3ef306105c19bd5903fcd3d02;hp=f5250b9b8c73916a1044b3e894c46e9e83f989f6;hpb=27a1965cc7b57e9de6d69504faaa3915a7cc959e;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index f5250b9b..432b61c4 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -408,8 +408,9 @@ class IrcBot } @client[:privmsg] = proc { |data| m = PrivMessage.new(self, server, data[:source], data[:target], data[:message]) - debug "Message target is #{data[:target].inspect}" - debug "Bot is #{myself.inspect}" + # debug "Message source is #{data[:source].inspect}" + # debug "Message target is #{data[:target].inspect}" + # debug "Bot is #{myself.inspect}" # TODO use the new Netmask class # @config['irc.ignore_users'].each { |mask| return if Irc.netmaskmatch(mask,m.source) } @@ -605,7 +606,7 @@ class IrcBot rescue SystemExit log_session_end exit 0 - rescue Errno::ETIMEDOUT, TimeoutError, SocketError => e + rescue Errno::ETIMEDOUT, Errno::ECONNABORTED, TimeoutError, SocketError => e error "network exception: #{e.class}: #{e}" debug e.backtrace.join("\n") rescue BDB::Fatal => e @@ -882,6 +883,11 @@ class IrcBot sendq "MODE #{channel} #{mode} #{target}", channel, 2 end + # kicking a user + def kick(channel, user, msg) + sendq "KICK #{channel} #{user} :#{msg}", channel, 2 + end + # m:: message asking for help # topic:: optional topic help is requested for # respond to online help requests