Skip to content

Slackbot receiving links #150

Closed
Closed

Description

@idenkov

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?

Activity

  1. mattmakai commented on Jan 24, 2018

    @mattmakai
    Owner

    hey @aoberoi, any idea on this potential parse_direction_mention URL handling quirk?

  2. aoberoi commented on Jan 24, 2018

    @aoberoi
    Contributor

    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.

  3. idenkov commented on Jan 30, 2018

    @idenkov
    Author

    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.

  4. aoberoi commented on Jan 30, 2018

    @aoberoi
    Contributor

    @idenkov good detective work! i'll try to reproduce this now.

  5. aoberoi commented on Jan 30, 2018

    @aoberoi
    Contributor

    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.

  6. added 2 commits that reference this issue on Jan 30, 2018
    5c12f22
    cabcf89
  7. aoberoi commented on Jan 30, 2018

    @aoberoi
    Contributor

    @mattmakai please also merge mattmakai/slack-starterbot#9 when you get a chance.

  8. added 2 commits that reference this issue on Jan 30, 2018
    838106d
    e4a3260
  9. mattmakai commented on Jan 30, 2018

    @mattmakai
    Owner

    thanks again @aoberoi, this is now merged and live. @idenkov everything work well on your end now?

  10. idenkov commented on Jan 30, 2018

    @idenkov
    Author

    Thanks, yep it works kind of lame took that bot id match for granted and didn't even think about it.

  11. added a commit that references this issue on Dec 23, 2018
    d6b4366
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions