From 0f277c32dd269937fbbe6427b416214ae70c70e2 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Tue, 8 Apr 2008 16:09:14 +0200 Subject: [PATCH] reaction plugin: use fake_message() --- data/rbot/plugins/reaction.rb | 11 ++++++++--- 1 file 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 -- 2.39.5