if the category doesn't exist, give an error instead of not replying
This commit is contained in:
parent
0e85323ea6
commit
10e05c91ae
@ -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|
|
||||
|
Loading…
Reference in New Issue
Block a user