I'm building a Slack bot with slash commands and I would like to post a message with an attachment as a specific user (specifically, the user that called the slash command).
I know this is possible because the Giphy Slack integration does so when responding to the /giphy [image]
command, by responding as the user with a gif image.
chat.meMessage
method but this does not appear to support attachments.as_user
argument in the chat.postMessage
method, but this inherits the authenticated user rather than the user that called the slash command.response_url
) doesn't seem to support non-bot responses. If they do, I can't seem to find where it's documented.In the slash request Slack does provide both user_id
and user_name
parameters, so I imagine I can make use of those.
I reached out to Slack with this question, and unfortunately at this time it doesn't look like what I'm asking for is possible. The Giphy Slack integration was internally built.
Maybe in the future!