snoonetIRC / CloudBot

CloudBot - The simple, fast, expandable, open-source Python IRC Bot!
GNU General Public License v3.0
67 stars 52 forks source link

Text is reformatted to be "web safe" #618

Closed gtwy closed 5 years ago

gtwy commented 5 years ago

The problem appears to be here:

https://github.com/snoonetIRC/CloudBot/blob/c6b0c9cbab90d708c215c63f31ef8900e16ccb51/cloudbot/clients/irc.py#L22

For instance, trying to send the following string to the channel yields this result.

string = 'Bot test. Disregard. &'

15:25:02 alt-l | Bot test. Disregard. &

linuxdaemon commented 5 years ago

That regex applies to incoming text only, there should be no escaping on send, and that regex doesn't do that kind of escape. Can you provide all relevant code/commands/logs?

gtwy commented 5 years ago

Here is some more detail from my plugin repo: https://github.com/gtwy/CloudBot-Plugins/issues/11

My bot is using conn.message(channel, string) for outbound messages.

https://github.com/gtwy/CloudBot-Plugins/blob/669f88d8a7a6f054e54b12678bf278ab75850e3e/follow_twitter.py#L111

Should I change the way I am sending text to the channel?

linuxdaemon commented 5 years ago

Can you create a minimal test case for this issue? I'm unable to replicate this by using conn.message("#channel", "Some message &"). I think it might be an issue with the data you are receiving from one of the APIs.

gtwy commented 5 years ago

Yes I'll do that tonight. I'll capture the data being sent from the API as well as sending 'Some message &' I'll close the ticket if it ends up being something on our end. Sorry for the trouble.

gtwy commented 5 years ago

Not an issue with cloudbot.