mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +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
|
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
Block a user