lib/lita/handlers/vader.rb in lita-vader-0.1.2 vs lib/lita/handlers/vader.rb in lita-vader-0.2.0
- old
+ new
@@ -1,14 +1,17 @@
module Lita
module Handlers
class Vader < Handler
+ template_root File.expand_path("../../../../templates", __FILE__)
+
route(/who is (.*)['’]s father\?/, :father, command: true, help: {
- "who is USER's father?" => "Replies back with the suprising truth."
- })
+ "who is USER's father?" =>
+ 'Replies back with the suprising truth.'
+ })
def father(response)
child = response.matches[0][0]
- response.reply("#{child}, I am your father!")
+ response.reply(render_template("paternity", child: child))
end
end
Lita.register_handler(Vader)
end