mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 19:52:54 +01:00
Changed randomquote to give the number of the quote
This commit is contained in:
parent
b38e5e2252
commit
273e426972
@ -140,14 +140,14 @@ class Quotes(DBHandler, callbacks.Privmsg):
|
||||
channel = privmsgs.getChannel(msg, args)
|
||||
db = self.getDb(channel)
|
||||
cursor = db.cursor()
|
||||
cursor.execute("""SELECT quote FROM quotes
|
||||
cursor.execute("""SELECT (id, quote) FROM quotes
|
||||
ORDER BY random()
|
||||
LIMIT 1""")
|
||||
if cursor.rowcount != 1:
|
||||
irc.error(msg, 'It seems that quote database is empty.')
|
||||
return
|
||||
quote = cursor.fetchone()[0]
|
||||
irc.reply(msg, quote)
|
||||
(id, quote) = cursor.fetchone()
|
||||
irc.reply(msg, '%s [#%s]' % (quote, id))
|
||||
return
|
||||
|
||||
def quoteinfo(self, irc, msg, args):
|
||||
|
Loading…
Reference in New Issue
Block a user