mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-19 08:59:27 +01:00
Fixed randomquote in the face of an empty database.
This commit is contained in:
parent
4b6f87f195
commit
d3e28c1cfe
@ -143,6 +143,9 @@ class Quotes(DBHandler, callbacks.Privmsg):
|
|||||||
cursor.execute("""SELECT quote FROM quotes
|
cursor.execute("""SELECT quote FROM quotes
|
||||||
ORDER BY random()
|
ORDER BY random()
|
||||||
LIMIT 1""")
|
LIMIT 1""")
|
||||||
|
if cursor.rowcount != 1:
|
||||||
|
irc.error(msg, 'It seems that quote database is empty.')
|
||||||
|
return
|
||||||
quote = cursor.fetchone()[0]
|
quote = cursor.fetchone()[0]
|
||||||
irc.reply(msg, quote)
|
irc.reply(msg, quote)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user