mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Added handling for case of a channel with no pairs/follows.
This commit is contained in:
parent
29efc019df
commit
11a674eb2b
@ -131,6 +131,9 @@ class Markov(callbacks.Privmsg, ChannelDBHandler):
|
||||
WHERE is_first=1
|
||||
ORDER BY random()
|
||||
LIMIT 1""")
|
||||
if cursor.rowcount == 0:
|
||||
irc.error(msg, 'I have no records for that channel.')
|
||||
return
|
||||
(id, first, second) = cursor.fetchone()
|
||||
id = int(id)
|
||||
words.append(first)
|
||||
|
Loading…
Reference in New Issue
Block a user