summaryrefslogtreecommitdiff
path: root/data/rbot
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-04-08 16:09:14 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-04-08 16:09:14 +0200
commit0f277c32dd269937fbbe6427b416214ae70c70e2 (patch)
tree4810576ed9db9316bf3325b2d9611372b0651755 /data/rbot
parent0779bf6e7247105b76b5a7563ffbf7a542fd8a4f (diff)
reaction plugin: use fake_message()
Diffstat (limited to 'data/rbot')
-rw-r--r--data/rbot/plugins/reaction.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/data/rbot/plugins/reaction.rb b/data/rbot/plugins/reaction.rb
index 3e6dacda..d358000c 100644
--- a/data/rbot/plugins/reaction.rb
+++ b/data/rbot/plugins/reaction.rb
@@ -263,9 +263,14 @@ class ReactionPlugin < Plugin
return unless reply
args = reply.apply(subs)
if args[0] == :cmd
- new_m = PrivMessage.new(@bot, m.server, m.source, m.target, @bot.nick+": "+args[1])
- @bot.plugins.delegate "listen", new_m
- @bot.plugins.privmsg(new_m) if new_m.address?
+ begin
+ # Pass the new message back to the bot.
+ # FIXME Maybe we should do it the alias way, only calling
+ # @bot.plugins.privmsg() ?
+ fake_message(@bot.nick+": "+args[1], :from => m)
+ rescue RecurseTooDeep => e
+ error e
+ end
else
m.__send__(*args)
end