class Voltron::Defender::When

Public Instance Methods

help() click to toggle source
# File lib/voltron/defender/commands/when.rb, line 9
def help
  "# Find out when the most recent exception occurred, or a specific exception if an id is given\n.when|.time [id]\n"
end
respond_with(adapter) click to toggle source
# File lib/voltron/defender/commands/when.rb, line 17
def respond_with(adapter)
  if error
    adapter.message("#{error.name} happened #{distance_of_time_in_words(Time.now, error.created_at)} ago")
  else
    adapter.message('Sorry, I wasn\'t able to find any exception to provide information on. Try specifying an exception id, like `.<command> <id>`')
  end
end
responds_to() click to toggle source
# File lib/voltron/defender/commands/when.rb, line 13
def responds_to
  ['when', 'time']
end