mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
Made quotes.randomquote simple dispatch to a quote with a --id option.
This commit is contained in:
parent
9543859047
commit
195dc208dd
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user