]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
Add act method to messages; behaves like reply, but does a CTCP action
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sun, 23 Jul 2006 23:04:15 +0000 (23:04 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sun, 23 Jul 2006 23:04:15 +0000 (23:04 +0000)
lib/rbot/message.rb

index 385f6c4cc8485fce0635e143c9a6f9d1014f9da7..eda7ef727743fa3a5ade15e9ebfe5775d862ea91 100644 (file)
@@ -198,6 +198,16 @@ module Irc
       @replied = true
     end
 
+    # convenience method to reply to a message with an action. It's the
+    # same as doing:
+    # <tt>@bot.action m.replyto, string</tt>
+    # So if the message is private, it will reply to the user. If it was
+    # in a channel, it will reply in the channel.
+    def act(string)
+      @bot.action @replyto, string
+      @replied = true
+    end
+
     # convenience method to reply "okay" in the current language to the
     # message
     def okay