Billies Wesley
Billies Wesley

Reputation: 457

is it possible to change a slack bots image & name when sending messages

I'm trying to build a slack bot that will post messages as various celebs; so message will appear at first glance to come form someone famous with their image. This isn't working. I managed to change the bots name&image but messages sent were going to the slackbot DM's page. I turned it into a chat app; but there when i change the profile it says invalid user. It lets me change the usernames of other people in the workspace but not the bot.

function changeProfile() {
  (async () => {
    const result = await web.users.profile.set({
      profile:{real_name: "Jacinda Adern"},
      user:"U0281UY0CSK". //id of bot
    });

  })();
}

Upvotes: 4

Views: 7143

Answers (1)

sandra
sandra

Reputation: 1566

You can try requesting the chat:write.customize scope (https://api.slack.com/scopes/chat:write.customize).

This scope will let you customize the username, icon_url and icon_emoji properties in a chat.postMessage call.

Upvotes: 6

Related Questions