Made quotes.randomquote simple dispatch to a quote with a --id option.

This commit is contained in:
Jeremy Fincher 2003-10-04 10:22:36 +00:00
parent 9543859047
commit 195dc208dd
1 changed files with 3 additions and 3 deletions

View File

@ -204,14 +204,14 @@ class Quotes(ChannelDBHandler, callbacks.Privmsg):
channel = privmsgs.getChannel(msg, args)
db = self.getDb(channel)
cursor = db.cursor()
cursor.execute("""SELECT id, quote FROM quotes
cursor.execute("""SELECT id FROM quotes
ORDER BY random()
LIMIT 1""")
if cursor.rowcount != 1:
irc.error(msg, 'It seems that quote database is empty.')
return
(id, quote) = cursor.fetchone()
irc.reply(msg, '%s (#%s)' % (quote, id))
(id,) = cursor.fetchone()
self.quote(irc, msg, [channel, '--id', str(id)])
def quoteinfo(self, irc, msg, args):
"""[<channel>] <id>