Permalink
Browse files

lolwtf

  • Loading branch information...
1 parent 906dff0 commit 9f534f46eda6aa3ffa6b6c4992cf98f28efca038 @vangberg vangberg committed Dec 4, 2009
Showing with 3 additions and 7 deletions.
  1. +3 −7 lib/isaac/bot.rb
View
@@ -142,7 +142,7 @@ def parse(input)
elsif msg.command == "PRIVMSG"
dispatch_privmsg(msg)
elsif msg.numeric_reply? && msg.command =~ /^[45]/
- dispatch_error
+ dispatch_error(msg)
elsif msg.command == "PING"
@queue.unlock
message "PONG :#{msg.params.first}"
@@ -171,7 +171,7 @@ def dispatch_privmsg(msg)
@bot.dispatch(type, env)
end
- def dispatch_error
+ def dispatch_error(msg)
env = {
:error => msg.command.to_i,
:message => msg.command,
@@ -223,11 +223,7 @@ def parse_prefix
end
def parse_command
- if @command =~ /^\d\d\d$/
- @numeric_reply = true
- else
- @numeric_reply = false
- end
+ @numeric_reply = !!@command.match(/^\d\d\d$/)
end
def parse_params

0 comments on commit 9f534f4

Please sign in to comment.