Class: Lita::Handlers::HowMany

Inherits:
Handler
  • Object
show all
Defined in:
lib/lita/handlers/how_many.rb

Instance Method Summary collapse

Instance Method Details

#how_many(response) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/lita/handlers/how_many.rb', line 9

def how_many(response)
  if config.upper_bound <= config.lower_bound
    log.error(t("bound_error", upper: config.upper_bound, lower: config.lower_bound))
  else
    response.reply(rand(config.lower_bound...config.upper_bound).to_s)
  end
end