Go to Slack

User Presence

A user can have one of two possible presence values, active or away. A user is active if they have at least one client connected to Slack, and they are not marked as "away". There are two ways a user can be marked as away: automatic and manual.

Automatic Away

The Slack message servers will automatically detect activity based on messages sent from a client. If they detect no messages in 30 minutes, the user is marked as automatically away.

However, it's possible to actively use a Slack client without causing any messages to be sent; in these situations the client can indicate activity has occurred by calling the API. Every Slack API method accepts an additional set_active argument. This can be used to indicate activity has occurred while performing the requested action.

If the user's activity generates no API calls then the client can periodically call users.setActive to let the Slack servers know about that activity.

These auto-away rules do not apply to Bot Users.

Manual Away

An application can call users.setPresence to manually mark a user as away or active. A manual status set using this method will persist between connections.

A manual away status set using this method overrides the automatic presence determined by the message server. A manual active presence set using this method indicates that the automatic status should be used instead.

Fetching user presence

When using the Real Time Messaging API the initial call to rtm.start will include the current presence value for every member of your team. If their presence value changes a presence_change event event will be sent.

When using our Web API, you can call the users.getPresence method to get the user's current presence value.

Bot presence

Bot users have their own form of being present on Slack.

When marked away, bots will have a grey dot next to their name. Many users interpret this demarcation to mean your bot is not currently available.

And when they are active, bots will have a green dot there. Users have been known to consider your green dot a badge of conversational readiness.

It's either/or. away or active. Grey or green.

Please don't use presence to telegraph Morse code or teach your bot to speak the binary language of moisture vaporators. Use chat.postMessage for that.

Events API bots

If your bot user runs on the Events API, you can only toggle your bot's active or away status by managing your app and its Bot Users panel, or for apps published in the App Directory, on the Live App Settings panel.

Toggling bot user presence for the events API

When set to Off, your bot user is only marked as online if it's connected to the RTM API.

When set to On, your bot user will be marked as active and present. That green dot is all yours. Just toggle back Off again to be marked away.

Your bot user's profile will include a always_active field set to true. Counter-intuitively, your bot's presence field will remain away. That's the bad news.

The good news is that always_active will be interpreted by Slack clients as if the bot user's presence were active. Yes, you're awarded that green dot.

RTM bots

If your bot user runs on the RTM API, your bot will be marked active to users whenever connected to the RTM API.

Bots cannot set their presence to active with users.setPresence. RTM bots can use it to set it to away. Or you can always automatically mark your bot as away by disconnecting from your websocket.