Closed catamphetamine closed 7 years ago
This is due to the way Slack's RTM API handles incoming messages -- less formatting is done on the Slack side.
For now, use bot.api.chat.postMessage directly. However, we will likely add a way to autodetect these patterns and/or manually specify how the bot should send messages in the near future.
You can also put the string into a message object and send that, the URL is then hidden. This works with conversations too.
var textContent = 'Click <http://site.example.com|here> to open in a web browser.'
var attachments = [{
text: textContent
}]
bot.reply(message, {
attachments: attachments
})
@halt-hammerzeit I was wrangling with the exact same issue. Looks like sending message like below works fine (as a workaround now):
{
text: 'The link is <http://DEV-1245.ru|DEV-1245>`,
attachments: []
}
It's a bit hacky as you pass empty array of attachments. It's because botkit internally uses attachments
existence to decide whether to use postMessage
or RTM.
Anyway it works for me as for now.
@mostr wow, what do you know...
@benbrown should I close this now?
If I do
bot.reply
then links in the message don't get parsedIf I do
bot.api.chat.postMessage
instead then the links get parsed correctly.