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