slack-bot-api
slack-bot-api copied to clipboard
Mentioned users not notified
When using postMessageToChannel
and @ mentioning someone they aren't receiving a notification.
I've also tried <@wadewegner>
in the message, and while that sends me a notification it also doesn't render properly:
And if I use <@wadewegner|WadeWegner>
I get no notification.
Marginal improvement. Passing in link_names: 'true'
as params ...
const params = {
link_names: 'true'
};
... and the following <@wadewegner|Wade Wegner>
results in a linked username for me ...
... but still isn't formatted correctly.
Also, it's interesting to note that the following two formats work correctly for channel:
<!channel>
<!channel|channel>
Okay ... so, looks like turning link_names
to true
makes the standard @wadewegner
work. Huh. That was quite the journey.
Okay, maybe not.
Here's some sample text: const message = 'I found a :neutral_face: [excitement (99.7%)] tweet! (FYI @wadewegner.)';
Now it's not notifying me.
If I change the sample text to const message = 'I found a :neutral_face: [excitement (99.7%)] tweet! (FYI @wadewegner .)';
(notice the space after @wadewegner
) it works.
Thanks @wadewegner for all debug ;) just what i was looking for ehehhe
@wadewegner does it still work? I used your solution but it isn't working for me
Passing link_names: true
worked for me. The bot wasn't able to create links to other channels until I added that like so:
bot.postMessage( event.channel, response, {
as_user: true,
link_names: true
} );