Disabling auto-embed links in Webhooks

Comments

11 comments

  • joep.io


    For webhooks from services that use links, it can really pollute an otherwise clean interface. 

     

    Some possible solutions:

    1. Make the webhook bot follow the @everyone right for embedding (kind of weird place to edit that setting, but the rights model would probably not need to change)
    2. Create a "disable embeds" boolean in webhook settings (this seems more intuitive) 
    4
  • TrumpetX

    I just hit up google to see if there was a solution to this problem.  Looks like you can add me to the list of people who would like this.

    0
  • Vankka

    If you can control the content you can put < and > around urls to hide the embeds (not just in webhook messages), not sure if this would work within [text](<url>) or not but it's probably worth a shot. Still would make it near impossible for something that can't be edited

    1
  • Chibbluffy

    Even if it's just text and not a link, it has an embed. It can be really annoying. I'd like a feature to disable webhook embeds as well.

    0
  • Pdog1

    Definitely want to add my name to this request. Gitlab in particular is causing a ton of spam for me. Just having integrations follow the @everyone permission would be acceptable.

    0
  • Steffen

    As others have said, it's possible to either give a link a custom title using [Wikipedia](https://en.wikipedia.org/) or to disable auto-embeds / unfurling using <https://en.wikipedia.org>. Is there a combined syntax to achieve both things?

    0
  • Steffen

    Answering my own question, it seems like you can use this: [Wikipedia](<https://en.wikipedia.org/>)

    1
  • byarn

    Reinvigorating this thread... so there is a way to turn off auto-embed for yourself (user settings), but is there a solution to turning off auto-embed in a chat channel for everyone (channel settings)?

    0
  • inkihh

    Steffen did you test that? When I post [Foo](<https://google.com>) via Webhook (Slack style), it just displays "Foo".

    0
  • Steffen

    Yes, we use our webhook this way multiple times everyday when posting new articles to our channel. We unfurl big review articles but don't unfurl news articles. It works for us.

    public static function buildLink($url, $title, $unfurl = false)
    {
        $escapedUrl = str_replace('(', '\(', str_replace(')', '\)', $url));
        $escapedTitle = str_replace('[', '\[', str_replace(']', '\]', $title));
        if (!$unfurl) $escapedUrl = '<' . $escapedUrl . '>';
        return '[' . $escapedTitle . '](' . $escapedUrl . ')';
    }

    0
  • wildflowericecoffee

    inkihh I need help with this as well, I get the same results as you when I try [text](<link>). It just shows up as the plain title without the link

    0

Please sign in to leave a comment.