A WeChat bot based on WeChatFerry that provides countdown functionality and integrates with various AI models for chat interactions.
For a detailed project introduction, please visit my blog post: Pi3's Notes
- Countdown management (add, delete, list, set reminder time)
- Integration with multiple AI models:
- Qwen (通义千问)
- Qwen VL (通义千问 VL, supports image input)
- Spark (讯飞星火)
- Automatic friend request acceptance
- Multi-user support
- Logging system
- Python 3.7+
- WeChatFerry
- Other dependencies listed in
requirements.txt
-
Clone the repository:
git clone https://github.com/Pi3-l22/WeChat_CountDownDay_Bot.git cd WeChat_CountDownDay_Bot -
Install the required packages:
pip install -r requirements.txt -
Set up API keys:
- Add Qwen API key to environment variables with the name
DASHSCOPE_API_KEY - Update Spark API credentials in
SparkChat.py
- Add Qwen API key to environment variables with the name
Log in to the bot's WeChat account on your computer's WeChat program.
Run the main script:
python main.py
The bot will start and listen for WeChat messages.
Enter the following commands directly in the chat window with the bot in WeChat:
$help: View help information$version: View version information$add [title] [date]: Add a countdown$del [title]: Delete a countdown$list: List all countdowns$set [time]: Set daily reminder time$send [wxid]: Set countdown recipient(s)$qwen: Switch to Qwen model$qwenvl: Switch to Qwen VL model$spark: Switch to Spark model$clear: Clear model history messages
main.py: Main entry point and message processingCountDown.py: Countdown functionalityQwenChat.py: Qwen model integrationQwenVL.py: Qwen VL model integrationSparkApi.py: Spark API implementationSparkChat.py: Spark model integration
- Countdown data is stored in
count_down_days.json - Contact and chatroom information is saved in
contacts.csvandchatroom.csv - Logs are saved in
run.log
This project is licensed under the MIT License - see the MIT LICENSE file for details.
- WeChatFerry for providing the WeChat bot framework
- Qwen for the AI model
- Spark for the AI model