Skip to content

Commit

Permalink
strip IRC color codes when logging 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Chlorophytus committed Jun 3, 2024
1 parent d68699e commit a28e204
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.25)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# Project instantiation
project(chlorobot VERSION 1.1.0.50)
project(chlorobot VERSION 1.1.1.51)

# Fetch gRPC
option(USE_SYSTEM_GRPC "Use system installed gRPC" ON)
Expand Down
2 changes: 1 addition & 1 deletion chloresolve/chloresolve/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.1.1+rev39"
__version__ = "1.1.1+rev40"
4 changes: 2 additions & 2 deletions chloresolve/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ async def message(self, channel: str, nickname: str, message: str) -> None:
myself: str = os.environ["CHLOROBOT_NICKNAME"]
if channel.startswith('#') or channel.startswith('&'):
# channel
self.logger.info(f"[{channel}] <{myself}> {message}")
self.logger.info(f"[{channel}] <{myself}> {ircstyle.unstyle(message)}")
try:
await self.send(None, b"PRIVMSG", [channel.encode()], f"{nickname}: {ircstyle.unstyle(message)}".encode())
await self.send(None, b"PRIVMSG", [channel.encode()], f"{nickname}: {message}".encode())
except UnicodeEncodeError:
self.logger.warning("Could not encode the last message into bytes!")
else:
Expand Down

1 comment on commit a28e204

@Chlorophytus
Copy link
Owner Author

@Chlorophytus Chlorophytus commented on a28e204 Jun 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't strip color codes yet but I'll fix it later.

Please sign in to comment.