From 171b4bea81315836b3e0d607f304e05c585e9f16 Mon Sep 17 00:00:00 2001 From: Alek Ratzloff Date: Sat, 4 Jun 2022 15:55:48 -0700 Subject: [PATCH] markov: Add random replies Forgot to implement this, oops Signed-off-by: Alek Ratzloff --- plugins/markov.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/markov.py b/plugins/markov.py index 2c9c371..dc3b6c0 100644 --- a/plugins/markov.py +++ b/plugins/markov.py @@ -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: