From 03e7c72c5b547647a027f4aafd850e481bd9dabf Mon Sep 17 00:00:00 2001 From: Jona Heitzer Date: Sat, 18 Oct 2025 23:48:46 +0200 Subject: [PATCH] Format log of send messages like received messages --- irc-topic-bot.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/irc-topic-bot.py b/irc-topic-bot.py index 62f50b0..ba75bfb 100644 --- a/irc-topic-bot.py +++ b/irc-topic-bot.py @@ -80,11 +80,11 @@ def connect_to_channel_and_check_topic(): # Send NICK and USER nick = f"NICK {IRC_NICK}\r\n".encode() - log(".", nick) + log(".", f"> {nick}") sock.sendall(nick) irc_user = f"USER {IRC_USER} 0 * :{IRC_REALNAME}\r\n".encode() - log(".", irc_user) + log(".", f"> {irc_user}") sock.sendall(irc_user) topic = None @@ -105,14 +105,14 @@ def connect_to_channel_and_check_topic(): resp = line.replace("PING", "PONG") pong = f"{resp}\r\n".encode() sock.sendall(pong) - log(".", pong) + log(".", f"> {pong}") # Check for end of MOTD or welcome to join channel if " 001 " in line and not joined: # Join channel join = f"JOIN {IRC_CHANNEL}\r\n".encode() sock.sendall(join) - log(".", join) + log(".", f"> {join}") joined = True # Capture topic sent by server upon joining @@ -134,7 +134,7 @@ def connect_to_channel_and_check_topic(): time.sleep(wait_time) bye = b"QUIT :Bye!\r\n" sock.sendall(bye) - log(".", bye) + log(".", f"> {bye}") sock.close() log("*", "Disconnected") return