Created
March 20, 2018 20:19
-
-
Save 1davidmichael/f12a867f6ca06188eec479ee39637968 to your computer and use it in GitHub Desktop.
Find recent Slack logins for a particular user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from slackclient import SlackClient | |
user = "username goes here" | |
slack_token = os.environ["SLACK_API_TOKEN"] | |
sc = SlackClient(slack_token) | |
response = sc.api_call( | |
"team.accessLogs", | |
count=1000 | |
) | |
for login in response['logins']: | |
if login['username'] == user: | |
print(login) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment