Dave Cook
Dave Cook

Reputation: 717

Slack App - Direct message NOT from slackbot

I have an app in Slack that sends direct messages to users. The messages always show up in the Slackbot channel and I would like to know if it is possible for the messages to show in the bot's own channel instead.

The app is made using bolt for NodeJS and here is my code:

app.client.chat.postMessage({
      channel: userSlackId,
      text: `TEXT HERE `,
      token: process.env.SLACK_BOT_TOKEN,
      icon_emoji: ":emoji",
      username: "Incident Bot",
    });

My scopes are:

chat:write
chat:write.customize
users:read

Upvotes: 2

Views: 420

Answers (1)

m.oulmakki
m.oulmakki

Reputation: 306

I believe you need the im:write scope as well to enable your app to directly message users.

You can update scopes from your app page -> OAuth & Permissions -> scroll down to scopes.

Upvotes: 2

Related Questions