link dify with wechat subscription account
⭐ If this plugin helps you, please give it a star! ⭐
Author: bikeread
Version: 0.0.5
Type: extension
GitHub: Repository | Issues
🎉 Major updates from v0.0.4 to v0.0.5:
Major updates from v0.0.3 to v0.0.4:
🚀 Love this project? Show your support by giving it a ⭐ on GitHub!
💡 Found it useful? Help others discover it by starring the repository!
🎯 Want updates? Star and watch to get notified of new features!
The Dify WeChat Official Account Plugin is designed for content creators and public account owners who want to integrate AI capabilities into their WeChat Official Accounts. It provides 24/7 intelligent customer service and content assistance.
Note: The timeout message is important because WeChat requires a response within 15 seconds. If your AI application takes longer to generate a complete response:
- The timeout message will be sent as an immediate response
- If AppID and AppSecret are configured, the complete AI response will be sent via WeChat's customer service message API
- Please ensure your Official Account has permission to send customer service messages
🎉 Success! If everything works perfectly, consider giving this project a ⭐ to help others find it!
This plugin supports multiple types of messages that your users can send to your WeChat Official Account:
msgId: Unique message ID
msgType: Message type ("text")
fromUser: Sender's OpenID
createTime: Message creation timestamp
content: The text message content
msgId: Unique message ID
msgType: Message type ("image")
fromUser: Sender's OpenID
createTime: Message creation timestamp
picUrl: URL of the image sent by user
msgId: Unique message ID
msgType: Message type ("voice")
fromUser: Sender's OpenID
createTime: Message creation timestamp
media_id: WeChat media ID for the voice
voice_base64: Base64 encoded voice data
voice_media_type: Media type of the voice
voice_format: Format of the voice (default "amr")
msgId: Unique message ID
msgType: Message type ("link")
fromUser: Sender's OpenID
createTime: Message creation timestamp
url: The shared URL
title: Title of the shared link
description: Description of the shared link
Your Dify application can access all these parameters in the conversation context and respond accordingly.
This plugin uses a modular design with the following main components:
endpoints/
├── wechat/ # Core WeChat processing module
│ ├── __init__.py # Package initialization
│ ├── models.py # WechatMessage model definition
│ ├── parsers.py # XML parser definition
│ ├── formatters.py # Response formatter definition
│ ├── factory.py # Message handler factory
│ ├── crypto.py # WeChat message encryption tools
│ ├── retry_tracker.py # Message retry tracker
│ ├── api/ # API-related
│ │ ├── __init__.py # API package initialization
│ │ └── custom_message.py # Customer service message sender
│ └── handlers/ # Message handlers
│ ├── __init__.py # Handlers package initialization
│ ├── base.py # Abstract handler base class
│ ├── text.py # Text message handler
│ ├── image.py # Image message handler
│ ├── voice.py # Voice message handler
│ ├── link.py # Link message handler
│ └── unsupported.py # Unsupported message type handler
├── wechat_get.py # Handle WeChat server verification
└── wechat_post.py # Handle user messages
If you find this plugin helpful, please consider:
Your support motivates continued development and improvement!