We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5751473 commit 07be5d1Copy full SHA for 07be5d1
csbot/plugins/quote.py
@@ -18,13 +18,14 @@ def _quote(self, nick):
18
19
#find quote by nick
20
quotes = self.db.find({'nick': nick})
21
+
22
+ #Find returns cursor, convert cursor iterator to list,
23
quote_list = list(quotes)
24
25
if len(quote_list) == 0:
26
self.QuoteError("No quotes by", nick)
27
- #Find returns cursor, convert cursor to list, randomly pick quote from returned quotes
- quote_list = list(quotes)
28
+ #Randomly pick quote from returned quotes
29
quote = random.choice(quote_list)
30
31
return (quote["quote"], quote["nick"])
0 commit comments