app icon
slack-bot2
0.0.2

This Slack Bot receives messages from Slack as input for Dify's Chatflow/Chatbot/Agent. In addition to app mentions, it can also trigger actions based on reactions, and supports posting messages to threads when sending messages to Slack.

takada-at/slack-bot2212 installs

Dify Slack Bot Plugin (slack-bot2)

Author: takada-at
Version: 0.0.2
Type: extension

Overview

This repository contains an Extension-type Dify plugin that connects Slack to a Dify application. The plugin listens to Slack events (app mentions and optionally reaction_added), invokes a configured Dify app, and posts the result back to Slack (optionally in a thread).

  • Entry point: main.py
  • Core endpoint: endpoints/slack_bot2.py (SlackBot2Endpoint)
  • Settings schema: group/slack-bot2.yaml
  • Plugin manifest: manifest.yaml

Features

  • App mentions: Responds when users mention the bot in Slack (@bot)
  • Reaction trigger: Optionally triggers on specified emoji reactions (reaction_added)
  • Thread replies: Optionally reply in the original message thread
  • Retry control: Configure whether to process Slack retry requests
  • Error handling: Acknowledge Slack events and surface meaningful errors

Setting Guide

1. Creating Your Slack App

  1. Visit the Slack API
  2. Click "Create New App"
  3. Select "From scratch"
  4. Define your app name and target workspace

2. Configuring the Slack App

On the "OAuth & Permissions" page, add the following scopes:

  • - To read mention events
  • - To read messages
  • - To post messages
  • - To read reaction events

Then

  • Install the app to your workspace
  • Locate your "Bot User OAuth Token" in settings

3. Endpoint Configuration

  • Create a new endpoint with a custom name
  • Input your Bot User OAuth Token
  • Set "Allow Retry" to false (recommended to prevent duplicate messages)
  • Link to your Dify chatflow/chatbot/agent
  • Save and copy the generated endpoint URL

For all other configuration options, please refer to the "Plugin Configuration" section below.

4. Configuring Slack App Event Subscriptions

On the "Event Subscriptions" page:

  1. Enable events by checking the "Enable Events" checkbox.
  2. In the "Request URL" field, enter your plugin's endpoint URL.
    • Format:
  3. Under "Subscribe to bot events," add the following events:
    • - For mentions directed at the bot
    • - For reaction additions (optional)

Plugin Configuration

1. Basic Settings

Bot Token

  • Required field
  • Enter the Bot User OAuth Token obtained from your Slack App (must start with )
  • The input field is secured, with the value being encrypted upon storage

App Selection

  • Required field
  • Choose the Dify app you want to use to respond to Slack messages
  • You may select from available apps in the dropdown menu

2. Advanced Settings

Allow Retry Requests

  • Optional field (default: false)
  • Determines whether to allow retry requests from Slack
  • If set to , the system will automatically ignore timeout or duplicate requests(Recommended)

Target Reactions

  • Optional field
  • Specifies reaction names to trigger a response, separated by commas
  • Example:
  • If left empty, the system will respond to all reactions

Enable Thread Reply

  • Optional field (default: false)
  • If set to , replies will be posted in the original message's thread
  • If set to , replies will be posted as new messages in the channel

Usage

The bot will respond when you mention it or use a specific emoji to react to a message.

Input Parameters

When triggered, contains the original Slack message. And the bot receives the following inputs data from the event.

ParameterDescriptionType
channelThe ID of the channel where the event happened.string
message_tsThe timestamp of the message.string
event_typeIndicates how the bot was triggered. Can be or .string
reactionThe name of the emoji used for the reaction (e.g., ). This is present only for events.string (optional)
CATEGORY
Extension
VERSION
0.0.2
takada-at·08/17/2025 03:45 PM
REQUIREMENTS
LLM invocation
Tool invocation
App invocation
Endpoint registration
Maximum memory
256MB
Maximum storage
1MB