I've written a Slack Bot in Python and it works as designed when I use a slash command in a chat channel, but when I try to interact with the bot in a direct message with another user, the response is never shown. However, when I look at the app logs, I still receive a POST from Slack, so my app is receiving the response and sends a response back.
I have the following permissions enabled:
- Send messages as [MyBotName]
- Send messages as user
- Post to specific channels in Slack
- Add a bot user with the username @mybotname
- Add slash commands and add actions to messages (and view related content)
- View some URLs in messages
- Add link previews to messages
In my code, I make the following api_call:
slack_client.api_call(
"chat.postMessage",
channel=[channelId],
attachments=[],
unfurl_links=True,
unfurl_media=True,
as_user=True
)
Logging shows that I do receive the right ChannelId no matter if it's a channel or direct message.
My question is: am I missing a permission or command in my slack_client.api_call?