diff --git a/systems/quote.rb b/systems/quote.rb index 59124d7..2b7bf28 100644 --- a/systems/quote.rb +++ b/systems/quote.rb @@ -24,12 +24,13 @@ module QuoteSystem end command :quote do |event, *message| - category = message[0].downcase + category = message[0] if category == nil quotes = db.execute("SELECT * FROM quotes") quote = quotes.sample event.channel.send_message("##{quote[0]} <#{quote[2]}>: #{quote[3]}") else + category = category.downcase quotes = db.execute("SELECT * FROM quotes WHERE category = ?", [category]) if quotes == [] event.channel.send_message("Uh, this is awkward. The category you're trying to get a quote from doesn't exist.")