Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable Slack URL suggestion?

I want to send a direct message to a Slack user which contains a website link in its text. Here is the text,

var msgText="Find us on < http://www.google.com|Google>";

and then POST,

method: "POST", url: "https://slack.com/api/chat.postMessage",
body: { "token": slackBotToken, "as_user":true, "channel":"@UserId","text":msgText}

This is what I get on my Slack account,

enter image description here

I want to remove the URL suggestion, any idea how to do that?

Thanks

like image 266
Chethan Shetty Avatar asked Oct 29 '22 23:10

Chethan Shetty


1 Answers

I got the answer from Slack Support, and I have verified that he is correct:

Thanks for getting in touch, and sorry for the troubles with unfurling. It's quite hidden in our documentation (we'll make it more clear), but in order to completely prevent link unfurling within a particular message, you'll need to set both unfurl_links and unfurl_media to false.

like image 82
Ryan Avatar answered Nov 15 '22 08:11

Ryan