bin/bot in boty-0.0.17.1 vs bin/bot in boty-0.1.0

- old
+ new

@@ -1,22 +1,19 @@ #!/usr/bin/env ruby require "./lib/boty" -def set_locale(locale) - begin - Boty.locale = locale || :en - rescue I18n::InvalidLocale - Boty.locale = :en - end - Boty::Locale.reload -end +Boty.locale = ARGV.pop || :en -set_locale ARGV.pop +Boty::Logger.adapter = Boty::Logger::Multi.new([ + Logger.new(STDOUT), + Logger.new("log/output.log", "daily") +]) session = Boty::Session.new -session.start do |bot| - bot.desc bot.name, I18n.t("template.presence", bot_name: bot.name) - bot.hear(/#{bot.name}/i) do +session.start do + desc name, I18n.t("template.presence", bot_name: name) + hear(/#{name}/i) do next if message_from_me? - say I18n.t "template.hello", user_name: message.user.name + logger.debug "saying hello" + say I18n.t "template.hello", user_name: user.name end end