fixed a bug that caused frequent unnecessary restarts
authorGeorgios Atheridis <atheridis@tutamail.com>
Fri, 9 Sep 2022 09:17:53 +0000 (10:17 +0100)
committerGeorgios Atheridis <atheridis@tutamail.com>
Fri, 9 Sep 2022 09:17:53 +0000 (10:17 +0100)
aptbot/bot.py

index c1e8ef6f68c745122ad33ee0e43ea85d7b288bc7..cabd595706475a4483fc6dd4b0ad892576d4aac5 100644 (file)
@@ -24,6 +24,8 @@ class Commands(Enum):
     PRIVMSG = "PRIVMSG"
     JOIN = "JOIN"
     PART = "PART"
+    PING = "PING"
+    PONG = "PONG"
 
 
 @dataclass
@@ -168,7 +170,7 @@ class Bot(ABCBot):
         logger.info(f"> {received_msg}")
         if received_msg == "PING :tmi.twitch.tv":
             self._send_command("PONG :tmi.twitch.tv")
-            return Message()
+            return Message(command=Commands.PING)
         elif received_msg == ":tmi.twitch.tv RECONNECT":
             self._restart_connection()
         elif not received_msg: