mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-12 13:12:35 +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)
|
channel = privmsgs.getChannel(msg, args)
|
||||||
db = self.getDb(channel)
|
db = self.getDb(channel)
|
||||||
cursor = db.cursor()
|
cursor = db.cursor()
|
||||||
cursor.execute("""SELECT quote FROM quotes
|
cursor.execute("""SELECT (id, quote) FROM quotes
|
||||||
ORDER BY random()
|
ORDER BY random()
|
||||||
LIMIT 1""")
|
LIMIT 1""")
|
||||||
if cursor.rowcount != 1:
|
if cursor.rowcount != 1:
|
||||||
irc.error(msg, 'It seems that quote database is empty.')
|
irc.error(msg, 'It seems that quote database is empty.')
|
||||||
return
|
return
|
||||||
quote = cursor.fetchone()[0]
|
(id, quote) = cursor.fetchone()
|
||||||
irc.reply(msg, quote)
|
irc.reply(msg, '%s [#%s]' % (quote, id))
|
||||||
return
|
return
|
||||||
|
|
||||||
def quoteinfo(self, irc, msg, args):
|
def quoteinfo(self, irc, msg, args):
|
||||||
|
Loading…
Reference in New Issue
Block a user