Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
    });

  })();
}
like image 501
Billies Wesley Avatar asked Sep 07 '25 00:09

Billies Wesley


1 Answers

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.

like image 188
sandra Avatar answered Sep 09 '25 16:09

sandra