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