Format log of send messages like received messages
This commit is contained in:
+5
-5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user