Closed idenkov closed 6 years ago
hey @aoberoi, any idea on this potential parse_direction_mention
URL handling quirk?
At a glance, I don’t see why the regex used wouldn’t work. But maybe I’m missing something. I’ll try to reproduce this soon.
Had a little bit of time today and it looks like when you sent this:
@BOT google.com
it receives
U4W3MKHKQ> ssh <http://google.com|google.com
and normal messages looks like that
U4W3MKHKQ
hi
Looks like it tries to remove the leading <
and the last >
from the return of that function. So the thing that removes <
and >
from the bot id, actually removes them from the whole message.
@idenkov good detective work! i'll try to reproduce this now.
I think i figured it out, all we have to do is modify the regular expression. we just need to make the +
non-greedy by changing it to +?
. I'll send some PRs.
@mattmakai please also merge https://github.com/mattmakai/slack-starterbot/pull/9 when you get a chance.
thanks again @aoberoi, this is now merged and live. @idenkov everything work well on your end now?
Thanks, yep it works kind of lame took that bot id match for granted and didn't even think about it.
Hi Matt,
Thanks for the tutorial! I am just getting started with python and decided doing it with a bot it could be interesting.
One problem I stumbled upon is that the function parse_direct_mention don't match if the message contains valid FQDN - slack transforms them into links and the input is something like this
<https://google.com|google.com>
Can you help with direction how to solve it?