From 273e426972b3f3032760ff41795314a3d6958f0b Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 25 Mar 2003 23:26:31 +0000 Subject: [PATCH] Changed randomquote to give the number of the quote --- plugins/Quotes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/Quotes.py b/plugins/Quotes.py index 90a6e8e30..23f8ed75e 100644 --- a/plugins/Quotes.py +++ b/plugins/Quotes.py @@ -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):