]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/script.rb
script plugin: hook on message() rather than listen()
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / script.rb
index 7a8c0c84696abc03ab36e2025a03c7577b148e8b..e3e718a70546350808ec410c4eb2abe1b17e09e8 100644 (file)
@@ -48,7 +48,7 @@ class ScriptPlugin < Plugin
   end
 
 
-  def listen( m )
+  def message( m )
     name = m.message.split.first
 
     if m.address? and @commands.has_key?( name )
@@ -112,7 +112,7 @@ class ScriptPlugin < Plugin
     code    = params[:code].to_s
     nick    = m.sourcenick
     created = Time.new.strftime '%Y/%m/%d %H:%m'
-    channel = m.target
+    channel = m.target.to_s
 
     command = Command.new( code, nick, created, channel )
     @commands[name] = command