From d439860ebd6915fdd2f52f66cb032106e55c4777 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Sun, 20 Apr 2014 05:13:39 -0700 Subject: Add quit command and fix PONG message. --- dinobot.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'dinobot.rb') diff --git a/dinobot.rb b/dinobot.rb index 7eb47f1..a00517f 100644 --- a/dinobot.rb +++ b/dinobot.rb @@ -56,6 +56,10 @@ module Dinobot @irc.part(channel) end + def quit(message) + @irc.quit(message) + end + def load_module(mod) mod = mod.downcase.intern @logger.info "Loading module: #{mod}" @@ -106,7 +110,7 @@ module Dinobot end def parse_line(str) - @irc.pong str.sub(/\APING /, 'PONG') if str =~ /\APING / + @irc.pong str.sub(/\APING /, '') if str =~ /\APING / if str =~ /(\S+) PRIVMSG (\S+) :(.*)/ user, channel, message = str.scan(/(\S+) PRIVMSG (\S+) :(.*)/).first @@ -163,7 +167,7 @@ module Dinobot case m.first when :say raise "wrong number of arguments -- #{m}" unless m.length == 3 - when :join, :part + when :join, :part, :quit raise "wrong number of arguments -- #{m}" unless m.length == 2 else raise "unknown method name -- #{m}" -- cgit v1.2.3-70-g09d2