diff options
-rw-r--r-- | lib/rbot/ircbot.rb | 1 | ||||
-rw-r--r-- | lib/rbot/plugins.rb | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index f9948750..97f8ead4 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -579,6 +579,7 @@ class Bot unless ignored @plugins.delegate "listen", m @plugins.delegate("ctcp_listen", m) if m.ctcp + @plugins.delegate "message", m @plugins.privmsg(m) if m.address? if not m.replied @plugins.delegate "unreplied", m diff --git a/lib/rbot/plugins.rb b/lib/rbot/plugins.rb index 5280a117..7631bfc3 100644 --- a/lib/rbot/plugins.rb +++ b/lib/rbot/plugins.rb @@ -82,6 +82,11 @@ module Plugins use message.ctcp_reply, which sends a private NOTICE to the sender. + message(PrivMessage):: + Called for all PRIVMSG. Hook on this method if you + need to handle PRIVMSGs regardless of whether they are + addressed to the bot or not, and regardless of + privmsg(PrivMessage):: Called for a PRIVMSG if the first word matches one the plugin #register()ed for. Use m.plugin to get |