Reputation: 1
I've created a slack bot that sends out a private message via the client.chat_postMessage method to different users in my workspace.
They've received the message (they showed me screenshots), however, I cannot see their private conversation via Slack it seems. Is there another way to monitor that the message has arrived and looks the way it's supposed to be (the format, attachments, etc. sent together)?
I tried this method:
response = client.conversations_info(
channel=,
include_num_members=1
)
but when I input the user's channel it returns that the channel doesn't exist.
Upvotes: 0
Views: 586
Reputation: 267
If you're using your bot token to send a message to a user, the message will show up in a DM between your bot and that particular user. Your bot is its own user, separate from your user. For that reason, if you login to Slack, you won't be able to view that conversation as you yourself are not a part of the conversation.
The only way to "view" a message that has been sent to a user within a DM is to call the conversations.history
method. Use the channel ID of the DM between the bot and your user, which will start with "D".
If you want to confirm how a message will look like within Slack, send the message to yourself beforehand. Additionally, adding logging within your code will help for any troubleshooting that you may need in the future.
Upvotes: 0