getting frequency on-insert should be execute_fetchone

This commit is contained in:
jesopo 2019-09-20 17:21:18 +01:00
parent fa405df36a
commit 0e9a8d66a7

View file

@ -27,8 +27,8 @@ class Module(ModuleManager.BaseModule):
inserts.append([words[-1], None, None]) inserts.append([words[-1], None, None])
for insert in inserts: for insert in inserts:
frequency = self.bot.database.execute("""SELECT frequency frequency = self.bot.database.execute_fetchone("""SELECT
FROM markov WHERE channel_id=? AND first_word=? frequency FROM markov WHERE channel_id=? AND first_word=?
AND second_word=? AND third_word=?""", AND second_word=? AND third_word=?""",
[event["channel"].id]+insert) [event["channel"].id]+insert)
frequency = (frequency or [0])[0]+1 frequency = (frequency or [0])[0]+1