class Ruboty::Handlers::Ghibli

Constants

PICTURES

Public Instance Methods

ghibli(message) click to toggle source
# File lib/ruboty/handlers/ghibli.rb, line 23
def ghibli(message)
  if title = message[:title]&.to_sym
    if PICTURES.key?(title)
      message.reply(PICTURES[title].sample)
    else
      message.reply("Unknown title. Use: #{PICTURES.keys.join(' ')}")
    end
  else
    message.reply(PICTURES[PICTURES.keys.sample].sample)
  end
end