mirror of https://github.com/Mikaela/Limnoria.git
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
|
WHERE is_first=1
|
||||||
ORDER BY random()
|
ORDER BY random()
|
||||||
LIMIT 1""")
|
LIMIT 1""")
|
||||||
|
if cursor.rowcount == 0:
|
||||||
|
irc.error(msg, 'I have no records for that channel.')
|
||||||
|
return
|
||||||
(id, first, second) = cursor.fetchone()
|
(id, first, second) = cursor.fetchone()
|
||||||
id = int(id)
|
id = int(id)
|
||||||
words.append(first)
|
words.append(first)
|
||||||
|
|
Loading…
Reference in New Issue