~deimos/madcow-bot

01e5c134cafbe14c4c6327ab177721816da3f836 — Chris Jones 8 years ago c890bc5
fix how slack wraps urls in brackets, screws up memebot
1 files changed, 2 insertions(+), 1 deletions(-)

M madcow/protocol/slack.py
M madcow/protocol/slack.py => madcow/protocol/slack.py +2 -1
@@ 15,6 15,7 @@ from madcow.conf import settings


class SlackProtocol(Madcow):
    _slack_link_re = re.compile(r'[<](https?://[^>]{1,})[>]')

    def __init__(self, base):
        super(SlackProtocol, self).__init__(base)


@@ 43,7 44,7 @@ class SlackProtocol(Madcow):
                    elif self.online:
                        if event_type == 'message':
                            private = False  # TODO need to determine if this is in DM
                            req = Request(message=event.event['text'])
                            req = Request(message=self._slack_link_re.sub(r'\1', event.event['text']))
                            req.nick = event.event['user']
                            req.channel = event.event['channel']
                            req.private = private