aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGravatar jesopo2019-10-04 10:12:52 +0100
committerGravatar jesopo2019-10-04 10:12:52 +0100
commit7e51165a239b2274ac6777655c0e9e84c7bb6ac3 (patch)
tree335b449061e5020c5bd877acd58d40948eae6788 /modules
parentpass whether a command.regex trigger was an ACTION or not (diff)
signature
check that `third_words` isn't empty
Diffstat (limited to 'modules')
-rw-r--r--modules/markov.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/markov.py b/modules/markov.py
index 28ba894c..884a3d18 100644
--- a/modules/markov.py
+++ b/modules/markov.py
@@ -154,10 +154,10 @@ class Module(ModuleManager.BaseModule):
third_words = self.bot.database.execute_fetchall("""SELECT
third_word, frequency FROM markov WHERE channel_id=? AND
first_word=? AND second_word=?""", [channel_id]+two_words)
+ if not third_words:
+ break
third_word = self._choose(third_words)
- if third_word == None:
- break
words.append(third_word)
return " ".join(words)