Skip to main content

My application keeps a local cache of a subset of the users in a workspace, mainly admins and a few others subscribed to some app-specific features. Now I want to listen to know when a user has been made an admin or removed as one. Also I want to know when a user has been deleted from a workspace to update my cache.

So currently I'm listening to the 'user_change' event for this, and this works fine but I get way too many events for just the use cases above.. and I don't seem to see any fields on the payload that allow me to filter them out. I looked at the 'user_profile_changed' and 'user_status_changed' event but the docs say they are identical to the 'user_change' event

 

What can I do here to reduce the number of events coming through since I'm listening for a small scope of change and my app is installed in fairly large workspaces.

6 respuestas
  1. 6 sept 2024, 15:58

    The complete list of Slack events is located here: https://api.slack.com/events

     

    Becoming an admin is a role change, so I am not sure if that will fire with a user_profile_changed event (I'd have to test it). You can certainly filter that in code if needed by looking at the is_admin property.

     

    As far as the workspace, you can look for events where a user is joining/leaving the #general/#welcome channel, as users are added/removed to that when added to/removed from a workspace.

0/9000