node.jsslackbolt

Getting <@[object Object]>! error when creating first HelloWorld bot in Slack / Bolt


I'm trying to create my first HelloWorld bot following this official tutorial using Bolt (https://api.slack.com/tutorials/hello-world-bolt).

The code is almost unchanged from the tutorial (only changed 'hello world' to 'hello bae'), however the User name is not being returned properly.

Can someone spot the issue? Thankyou so much in advance!

enter image description here

Bug in Slack:

enter image description here


Solution

  • Based on the code shared above, you have created a new object user with properties user & channel.

    Therefore, the correct syntax would be :
    say(`Hello bae, and welcome <@${user.user}>!`);