This page is being phased out as part of our documentation reorganization.
Click this card to be redirected to the updated version with the most current information.
If you notice any discrepancies or areas needing improvement in the new documentation, please use the âReport an issueâ button at the bottom of the page.
To avoid confusion, the following concepts are explained:How It Works (A Simple Overview):
- Slack Bot A chatbot on the Slack platform, acting as a virtual user you can interact with in real-time.
- Slack Bot Plugin A plugin in the Dify Marketplace that connects a Dify application with Slack. This guide focuses on how to develop that plugin.
extension
template, and grant both Apps
and Endpoints
permissions.
For additional details on reverse-invoking Dify services within a plugin, see Reverse Invocation: App.
group/slack.yaml
. The formâs filename is determined by the info you provided when creating the plugin, so adjust it accordingly.
Sample Code:
slack.yaml
endpoints/slack.yaml
file, change the request method to POST to handle incoming Slack messages properly.
Sample Code:
endpoints/slack.yaml
endpoints/slack.py
file and add the following code:
python -m main
to start the plugin. You should now see your plugin installed in the Workspace on Difyâs plugin management page. Other team members will also be able to access it.
self.session.app.chat.invoke
is used to call the Dify application, passing in parameters such as app_id
and query
. The response is then returned to the Slack Bot. Run python -m main
again to restart your plugin for debugging, and check whether Slack correctly displays the Dify Appâs reply:
slack_bot.difypkg
file in the current directoryâyour final plugin package.