Revert "Revert "Make the handle a template parameter""

master
Zach Thompson 2016-02-16 16:15:00 -07:00
parent f25a6f070e
commit 037b566b97
2 changed files with 6 additions and 6 deletions

View File

@ -14,12 +14,12 @@ zci answer_type => '<: $ia_id :>';
zci is_cached => 1;
# Triggers - http://docs.duckduckhack.com/walkthroughs/calculation.html#triggers
triggers any => 'triggerword', 'trigger phrase';
triggers <: $ia_trigger :>;
# Handle statement
handle remainder => sub {
handle <: $ia_handler :> => sub {
my $remainder = $_;
my <: $ia_handler_var :><: $ia_handler :> = <: $ia_handler_var :>_;
# Optional - Guard against no remainder
# I.E. the query is only 'triggerWord' or 'trigger phrase'

View File

@ -13,10 +13,10 @@ zci answer_type => '<: $ia_id :>';
zci is_cached => 1;
# Triggers - https://duck.co/duckduckhack/goodie_triggers
triggers any => 'triggerword', 'trigger phrase';
triggers <: $ia_trigger :>;
# Handle statement
handle remainder => sub {
handle <: $ia_handler :> => sub {
return "plain text response",
structured_answer => {
@ -31,7 +31,7 @@ handle remainder => sub {
name => 'Answer',
data => {
remainder => $_
<: $ia_handler :> => \<: $ia_handler_var :>_
},
templates => {