Search code examples
slack

Bot postMessage missing icon and name


Using a custom bot, I can postMessages (doc) into a channel (with the bot's auth-token). However, the messages don't show my bot's icon or name, just the default bot's one:

slack-bot

When I change topic, it works fine (i.e. the icon and name of my custom bot appear).

Is there some extra configuration needed?


Solution

  • Seems the as_user=true param is needed. Doc is somewhat confusing in this regard:

    as_user Optional
    Pass true to post the message as the authed user, instead of as a bot
    

    The authed user in this case, is the bot whose auth-token you've used.