summaryrefslogtreecommitdiff
path: root/data/rbot/plugins/reaction.rb
diff options
context:
space:
mode:
Diffstat (limited to 'data/rbot/plugins/reaction.rb')
-rw-r--r--data/rbot/plugins/reaction.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/data/rbot/plugins/reaction.rb b/data/rbot/plugins/reaction.rb
index a61be294..2887d574 100644
--- a/data/rbot/plugins/reaction.rb
+++ b/data/rbot/plugins/reaction.rb
@@ -197,7 +197,8 @@ class ReactionPlugin < Plugin
"Replies can use the %%{key} syntax to access one of the following keys: " +
"who (the user that said the trigger), bot (the bot's own nick), " +
"target (the first word following the trigger), what (whatever follows target), " +
- "stuff (everything that follows the trigger), match (the actual matched text)"
+ "stuff (everything that follows the trigger), match (the actual matched text), " +
+ "match1, match2, ... (the i-th capture)"
when :list
"reaction list [n]: lists the n-the page of programmed reactions (30 reactions are listed per page)"
when :show
@@ -226,6 +227,9 @@ class ReactionPlugin < Plugin
:what => what,
:stuff => stuff
}
+ match.to_a.each_with_index { |d, i|
+ extra[:"match#{i}"] = d
+ }
subs = @subs.dup.merge extra
reply = wanted.pick_reply
debug "picked #{reply}"