Any way to handle message formatting? (colors etc.)
Maybe I'm missing something but currently I can't seem to figure out how to get the messages without the leftover from the formatting. All I did was adding a print(message) line to the 'Basic Usage' example's on_message method and enter a channel that's full of formatting. Here's the output:
https://i.imgur.com/kqRVlmG.png
It does leave the color codes in the message. For example the 04 is red etc. What should I do to get only the plain text message without any type of formatting? (colors, bold, italic etc.)
I found an answer elsewhere on how to strip the colors, but I'm not sure where to apply it:
regex = re.compile("\x1f|\x02|\x12|\x0f|\x16|\x03(?:\d{1,2}(?:,\d{1,2})?)?", re.UNICODE)
Thank you.
Given that regexp, you'd run message = regex.sub(message, '') on the message. I'm not sure if we want to support complete message stripping like that in Pydle itself, however.
I don't believe its Pydle's job to strip color formatting from incoming IRC messages, though it can be relatively easily implementable as a service function.
I believe the implementation of such behavior should be differed to your bot's implementation.