Slack logon trigger
Asked Answered
S

2

1

I want to create something in Slack that sends a message (starting by calling someone with '@') to a channel when specific users login. I've checked ifttt and zapier. I also checked the slack api to create something myself, but I couldn't really find anything usefull.

Anyone has any ideas?

Saltsman answered 12/10, 2017 at 12:51 Comment(0)
G
0

Slack does not track user login or logoff in a traditional sense. Instead, users are always always "logged in" and available to receive messages once they have joined a team / channel.

There also is the concept of "presence", which is related, but not the same thing. User presence can change multiple times during a few minutes, e.g. if the user is on a mobile. I am guessing you would not want to send the user your message that often.

Still you can poll the presence information of a user with the API users.getPresence , which could be used to implement a script that polls this information on a regular basis and send your message. You also want to filter out presence changes below a certain duration threshold.

Keep in mind though that the rate limit for API methods is 1 per second. So depending on how many users you have in your workspace there will be a significant delay between the user becoming "present" and your script being able to send the message.

Gerardogeratology answered 12/10, 2017 at 13:37 Comment(1)
What I actually want to do is set drift (website live chat app) to on when one or more of the designated ppl who manage it are online. When the last one goes offline it should switch to off. By issuing @drift on/off in a channel you can do this. But I can't find an option in slack where you can just execute scripts?Saltsman
D
0

There is a workaround for that to have a google sheet as a database for the users and you can trigger by day once and timestamp it.

So the best trigger is a private message or public and you can use filter when mentioning or signin or signout it depends on the trigger word then you pass the filter since zapier won't count your zaps if you used fiter as a second step.

Duthie answered 9/5, 2019 at 12:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.