slack_example
- Meaningless work on the slack
How to set up
- Install
slack-sdk
# pip install slack_sdk
- or Install
requests
# pip install requests
- Create Slack application bot and Set authorization scopes
e.g) if you want to know uploaded file information in a Specific channel, grant these scope to the Bot.
Two Slack API are used.
1) https://api.slack.com/methods/conversations.history
channels:history
groups:history
im:history
mpim:history
2) https://api.slack.com/methods/users.info
users:read
users:read.email
:note:
Apps created after January 4th, 2017 must request both the users:read and users:read.email OAuth permission scopes to access the email field of user objects.
(default: not show email field) so, If not grant users:read.email, email field does not return.
Refer to a API guide link
Examples - python slack_sdk/requests
- Retrieve the list of users who have joined on channel
- Retrieve all users in slack workspace
- Retrieve the uploaded files what files uploaded on channel
- Bot sending direct message to user
- Bot send a file to channel
- Bot send a file to user as a direct_message
And...
- If you find this helpful, please consider giving it a "star"🌟 to support further improvements.