From a09f7b1d7e8ca105c12638c14803441349946afb Mon Sep 17 00:00:00 2001 From: mio Date: Fri, 5 Oct 2018 15:31:06 +0000 Subject: [PATCH] Fix pong response --- itte.py | 5 +++-- ramenkan.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/itte.py b/itte.py index 28b0bdc..66a5cb4 100644 --- a/itte.py +++ b/itte.py @@ -72,8 +72,9 @@ class IRC: def keepalive(self, line): """Stay connected to a server by responding to server pings.""" - if "PING" in line: - self.send("PONG", ":" + line.split(":", 2)[1].split(" ", 1)[0]) + resp = line.split(" ", 1)[1] + if ("PING " + resp) in line: + self.send("PONG", resp) def join_channels(self, channels): """Join channels given a list of channel names.""" diff --git a/ramenkan.py b/ramenkan.py index b6a6d73..9b9cdad 100755 --- a/ramenkan.py +++ b/ramenkan.py @@ -86,7 +86,7 @@ class Ramen: combo += self.rand(dish["broth"] + dish["broth-veggie"]) combo += " broth" # Topping - n_top = randint(2, 4) + n_top = randint(2, 5) for n in range(2, n_top+1): if n == 2: if is_veggie: