Creator Center
/Extension/wecom-bot
app icon

wecom-bot

Verified by Dify
No ratings yet
0
A
anspire/wecom-bot

The Enterprise wechat intelligent robot is supported by Anspai, an official partner of Enterprise wechat.

anspire-wecom-bot

Author: anspire
Version: 0.0.2
Type: tool

Description

Description

This WeChat Work (企业微信) bot plugin enables seamless integration between WeChat Work and Dify applications. It allows you to receive messages from WeChat Work as input for Chatflow/Chatbot/Agent in Dify and
automatically send the responses back to WeChat Work.

The plugin provides a complete solution for creating AI-powered chatbots within WeChat Work environments, leveraging Dify's powerful AI capabilities.

Features

  • Bidirectional Communication: Receive messages from WeChat Work and send responses back
  • Secure Message Handling: Implements WeChat Work's encryption and signature verification
  • Dify Integration: Connects with any Dify application (chatbots, workflows, agents)
  • Flexible Configuration: Supports custom Corp ID, Bot Token, and AES encryption key
  • Robust Error Handling: Comprehensive error handling and logging

Architecture

The plugin follows Dify's plugin architecture and includes:

  • Endpoints: /qw/callback endpoint supporting both GET (URL verification) and POST (message processing)
  • Encryption Service: Implementation of WeChat Work's message encryption/decryption protocol
  • Dify Integration: Direct connection to Dify apps for AI processing
  • Configuration Interface: Secure input for authentication credentials

Prerequisites

  • Dify instance (self-hosted or cloud)
  • WeChat Work account with application setup
  • Bot Token and Encoding AES Key from your WeChat Work application

Installation

  1. Install the plugin in your Dify instance
  2. Configure the required settings in the plugin configuration:
    • Corp Id: Your WeChat Work enterprise ID
    • Bot Token: Your WeChat Work application token
    • Encoding AES Key: Your WeChat Work application AES key
    • App: Select the Dify app to handle WeChat Work messages
    • Allow Retry (optional): Enable/disable retry logic

Configuration

WeChat Work Setup

  1. Create an application in your WeChat Work admin panel
  2. Note down the Corp ID, Agent ID, and Secret
  3. Set up the callback URL pointing to your Dify instance with the endpoint /qw/callback
  4. Generate a Bot Token and Encoding AES Key in your application settings

Plugin Configuration

  1. Enter your Corp ID in the plugin settings
  2. Input your Bot Token and Encoding AES Key
  3. Select the Dify app that will process incoming messages
  4. Save the configuration

How It Works

Message Flow

  1. URL Verification: WeChat Work verifies the callback URL by sending a verification request
  2. Message Reception: When users send messages to the bot, WeChat Work posts encrypted XML/JSON data to the callback endpoint
  3. Decryption: The plugin decrypts the message using the provided AES key
  4. Processing: The decrypted message text is sent to the configured Dify app for AI processing
  5. Response: The Dify app's response is formatted and sent back to the user via WeChat Work
  6. Delivery: The response appears as a message from the bot in the user's WeChat Work client

Security

  • All communication between WeChat Work and the plugin is secured using WeChat's signature verification
  • Messages are encrypted using the AES key before transmission
  • Sensitive information like tokens and keys are stored securely
CATEGORY
Extension
VERSION
0.0.2
anspire·Updated 9 months ago
REQUIREMENTS
App invocation
Endpoint registration
Maximum memory
256MB
Maximum storage
100MB
Access domain

Not scanned

Security
Security Rating
Give a rate
SHARE WITH