Fix a couple small bugs in markov bot
* .items() call required when loading a markov chain into memory * `who.nick` instead of `who~ for get_chain call Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -101,7 +101,7 @@ class Chain:
|
||||
for word, weight in value.items()
|
||||
},
|
||||
)
|
||||
for key, value in obj["chain"]
|
||||
for key, value in obj["chain"].items()
|
||||
},
|
||||
)
|
||||
self.__dirty = False
|
||||
@@ -192,7 +192,7 @@ class Markov(Plugin):
|
||||
self.add(channel, who.nick, line)
|
||||
# also, maybe generate a sentence
|
||||
chosen = random.random()
|
||||
chain = self.get_chain(channel, who)
|
||||
chain = self.get_chain(channel, who.nick)
|
||||
if chosen <= chain.reply_chance:
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user