问题
I am trying to make my app watch for every kind of messages (public/private channels and direct messages) using event subscriptions, no bot.
I made my app subscribe to message.channels
, message.groups
, message.im
and message.mpim
events.
I've setup an endpoint URL with the challenge parameter, and I've authorized and deployed my app. I'm successfully notified when :
- A message is posted in a public channel
- A message is posted in a private channel (even if my personal account is not invited in)
- A direct message to/from my personal account
But, I'm not notified when there is a direct message posted between two other people.
How can it be related to my personal account as I've installed the app on the whole workspace ?
回答1:
It is not supposed to work. Even if you subscribe to "Workspace Events" you should only be able to see messages of conversations that the user that installed the Slack app is invited in. Including private channels and IM.
I just tested this on my Slack. Installed the Slack app with an owner user, but still can only see messages from private channels, that that user is a member of.
So this works "as designed" and according to the security architecture of Slack.
来源:https://stackoverflow.com/questions/49282271/slack-api-message-im-event-is-not-triggered-for-other-users