pinterest / slackminion

A python bot framework for slack
MIT License
22 stars 14 forks source link

Remove extra (double etc.) spaces in _parse_message #60

Closed jogo closed 2 years ago

jogo commented 2 years ago

When parsing a message if the person adds an extra space, 'foo bar' becomes ['foo', '', 'bar'] and can break plugins since the cmd matching has to be exact (no extra spaces).

amckenna-pinterest commented 2 years ago

While we're at it we might as well fix line 106 as well

jogo commented 2 years ago

While we're at it we might as well fix line 106 as well

I was thinking about that earlier and don't know if there can ever by multiple spaces going into it, as msg_args already went through self._parse_message and line 106 is removing the space from line 102. I can't think of a reason why it wouldn't be safe to remove though, just can't think of a case where leaving it in would cause a bug. What's your recommendation?

amckenna-pinterest commented 2 years ago

I can't really envision a scenario in which a plugin writer would want to count individual spaces as arguments but also I can't think of a way leaving it in would cause a bug so let's leave it in for now.