diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rbot/botuser.rb | 10 | ||||
-rw-r--r-- | lib/rbot/messagemapper.rb | 4 |
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/rbot/botuser.rb b/lib/rbot/botuser.rb index 41fca6cf..52b83151 100644 --- a/lib/rbot/botuser.rb +++ b/lib/rbot/botuser.rb @@ -101,6 +101,16 @@ class String end
+class Symbol
+
+ # Returns an Irc::Auth::Comand from the receiver
+ def to_irc_auth_command
+ Irc::Auth::Command.new(self)
+ end
+
+end
+
+
module Irc
diff --git a/lib/rbot/messagemapper.rb b/lib/rbot/messagemapper.rb index 39b258e3..e009f030 100644 --- a/lib/rbot/messagemapper.rb +++ b/lib/rbot/messagemapper.rb @@ -47,7 +47,7 @@ module Irc def initialize(parent) @parent = parent @templates = Array.new - @fallback = 'usage' + @fallback = :usage end # args:: hash format containing arguments for this template @@ -162,7 +162,7 @@ module Irc debug "#{f.inspect} => #{r}" } debug "no handler found, trying fallback" - if @fallback != nil && @parent.respond_to?(@fallback) + if @fallback && @parent.respond_to?(@fallback) if m.bot.auth.allow?(@fallback, m.source, m.replyto) @parent.send(@fallback, m, {}) return true |