A user can have one of two possible presence values,
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
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.
An application can call users.setPresence
to manually mark a user as
active. A manual status set using this
method will persist between connections.
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.
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.
Bot users have their own form of being present on Slack.
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.
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.
If your bot user runs on the Events API, you can only toggle your bot's
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.
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.
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
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.