template/project/bot.tt in boty-0.0.10 vs template/project/bot.tt in boty-0.0.11
- old
+ new
@@ -1,11 +1,13 @@
#!/usr/bin/env ruby
require "./<%= bot_name %>"
+Boty.locale = ARGV.pop || :en
+
session = Boty::Session.new
session.start do |bot|
- desc "Responds when the bot name (<%= bot_name %>) is mentioned in a message."
- bot.message(/<%= bot_name %>/i) do |message|
+ bot.desc I18n.t "template.presence", bot_name: bot.name
+ bot.message(/<%= bot.name %>/i) do |message|
next if message.from? self
- say "Ohay <@#{message.user}>! I'm here, that's for sure."
+ say I18n.t "template.hello", user_name: message.user.name
end
end