问题
I have a requirement where I have to do some preliminary setup for my slack-bot. What I want to do is:
- Get the notification when my slack app is installed to a workspace.
- Send a private message to the admin of the workspace with instructions/setup manual.
I am looking at slack event API docs and it looks like that it does have an app uninstalled
event, but nothing related to install.
How would I achieve above mentioned goals for my slack bot? Can I do that with event api
or do I have to use RTM
?
回答1:
There is no event for app install, because you do not need one.
To install an app the user has to go through the mandatory OAuth2.0 process to authenticate your app for a workspace. So you app will always get an OAuth request and later in the process the details about the team and user who is installing your app.
You also can just send a private message to the installer once the process is completed and you have the token.
The OAuth process has its own API methods and is not part of RTM or Event API.
Here is a link to an implementation example in Python on how the installation process works: Installation Example
来源:https://stackoverflow.com/questions/57815090/how-to-get-notified-when-the-slack-app-is-installed