问题
I am building a Python script which retrieves a set of information for all Slack users of the organization that I work. Currently, I was asked by the stakeholders to retrieve the last time that our organization's users were active on Slack. I came across the users.getPresence method but this can only return a timestamp for the owner of the token. Has anybody worked on that before? Thanks.
回答1:
It depends a bit how you define "active on Slack".
If getting the date and time a user was logged in last is enough, take a look at team.accessLogs, which will give you the timestamp of the last login for every user (date_last
).
This will not reflect whether the user performed any activity, e.g. posting a message or uploading a file though.
However, note that this API method works for paid plans only.
来源:https://stackoverflow.com/questions/50280153/way-to-get-timestamp-of-last-activity-for-all-slack-users