0

I want to know when any user is connected to my slack workspace. I know that with presence_change event I can get that info, but passing the user ID.

What I want to achieve is to send an event to my app (right now using ngrok) when any user is connected (eg. it status changes from disconnected to connected)

EDIT:

Finally I discovered that if you listen that event without user_id, it will returns the ID of the user that triggered that event. If this help anyone.

Erik Kalkoken
  • 30,467
  • 8
  • 79
  • 114
Juan Wilde
  • 134
  • 1
  • 5

1 Answers1

0

I know you already answered you own question and it's kinda old now, but it could help others.

Here is what could be done:

  • create a slack app

  • enable event subscriptions for this app in order to call your application webhook each time the 'presence change' event happens

  • in you application code, call slack api to get more details about the user that triggered this event

I detailed how to do these steps in this blog post for a very similar use case, but for another slack event (bot events), if needed: https://blog.eleven-labs.com/en/en/replace-erp-by-slack-bot-with-dialogflow-and-symfony/

Cherik
  • 246
  • 2
  • 5
  • Yes. It is another solution. I've tried it but for my use case I finally decided to create a Symfony command with an event listener (Botman package). Thanks for your answer :) – Juan Wilde Jan 08 '18 at 07:54