markov: Add random replies

Forgot to implement this, oops

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2022-06-04 15:55:48 -07:00
parent 6a18a2161c
commit 171b4bea81

View File

@@ -197,7 +197,9 @@ class Markov(Plugin):
chosen = random.random()
chain = self.get_chain(channel, who.nick)
if chosen <= chain.reply_chance:
pass
message = chain.generate()
if message:
self.send_to(conn, channel, f"{who.nick}: {message}")
def get_chain(self, channel: str, who: str) -> Chain:
if channel not in self.__chains: