Build a Smart WeChat Bot: Integrate DeepSeek, ChatGPT, Kimi, and More

Introduction

A WeChat Bot is an automation software based on the WeChat platform that can simulate human user behavior to perform a series of tasks, typically for personal or business purposes. WeChat bots can perform the following functions and operations:

  • Automatic message replies: When users send messages to the bot, it can automatically reply with preset text, images, videos, or other types of messages.

  • Keyword triggers: The bot can trigger specific replies or actions based on keywords in user messages.

  • Group management: In WeChat groups, the bot can help manage group members, such as welcoming new members, kicking out rule-breaking members, and posting group announcements.

  • Message forwarding: The bot can forward received messages to other chats or group chats.

  • Scheduled tasks: The bot can be set to send messages at scheduled times, such as daily news, weather forecasts, reminders, etc.

  • Intelligent conversation: By combining natural language processing technology, the bot can understand and respond to more complex conversations.

  • Zombie follower detection: The bot can help users detect and clean up inactive or fake WeChat friends.

  • Data analysis: The bot can collect and analyze chat data for market research or user behavior analysis.

  • Customer support: Provides automated customer service for businesses, answering common questions and improving efficiency.

WeChat bots are usually implemented through WeChat’s API, third-party development frameworks (such as WeChaty), or by simulating the behavior of the WeChat client. Due to the restrictions on automation scripts by WeChat’s official policies, using WeChat bots may violate WeChat’s service terms, so care should be taken to comply with relevant rules and regulations.

Build a Smart WeChat Bot: Integrate DeepSeek, ChatGPT, Kimi, and MoreCurrently Supported AI Services

  • DeepSeek

Get your own <span>API key</span>, click here 👉🏻 : DeepSeek Open Platform and fill in the obtained <span>API key</span> into the <span>.env</span> file under <span>DEEPSEEK_FREE_TOKEN</span>.

ChatGPT

First, get your own <span>API key</span>, click here 👉🏻 : Create Your API Key

Note: This requires a paid subscription. Many people ask why requests fail, please ensure the terminal is using a proxy and that you have purchased the service.

# Execute the command below to copy the .env.example file to .env
cp .env.example .env
# Fill in the content of the .env file
OPENAI_API_KEY='your_key'
  • Tongyi Qianwen

Tongyi Qianwen is an AI service provided by Alibaba Cloud. After obtaining your API key, fill it into the .env file.

# Execute the command below to copy the .env.example file to .env
cp .env.example .env
# Fill in the content of the .env file
# Tongyi Qianwen, URL includes URI path
TONGYI_URL = "https://dashscope.aliyuncs.com/compatible-mode/v1"
# Tongyi Qianwen's API_KEY
TONGYI_API_KEY = ''
# Model used by Tongyi Qianwen
TONGYI_MODEL='qwen-plus'
  • iFlytek

Apply for a key here: iFlytek, each model has 2 million free tokens, which is hard to exhaust.Note: There are several keys in the iFlytek configuration file, do not fill them in incorrectly. Many people come to me asking why they don’t get replies, it’s all because they filled them in incorrectly.Moreover, another advantage is that the interface is not as limited in request frequency as Kimi, making it relatively stable.If there are service errors, refer to: issues/170, issues/180

Kimi (request limitations are severe)

You can go to: Kimi API Key to get your key. Recently quite busy, if anyone is interested, you can submit a PR, and I will merge it as soon as possible. Currently, Kimi has just been integrated, and can also implement file uploads and other functions. Other better services can also submit PRs.

Build a Smart WeChat Bot: Integrate DeepSeek, ChatGPT, Kimi, and More

  • Dify

Address: Dify, after creating your application and obtaining your API key, fill it into the .env file. It also supports private deployment of the Dify version.

# Execute the command below to copy the .env.example file to .env
cp .env.example .env
# Fill in the content of the .env file
DIFY_API_KEY='your_key'
# If private deployment is needed, please modify the configuration below in .env
# DIFY_URL='https://[your_private_deployment_address]'
  • Ollama

Ollama is a localized AI service, its API is very similar to OpenAI. The configuration process for Ollama is slightly different from various online services.

# Execute the command below to copy the .env.example file to .env
cp .env.example .env
# Fill in the content of the .env file
OLLAMA_URL='http://127.0.0.1:11434/api/chat'
OLLAMA_MODEL='qwen2.5:7b'
OLLAMA_SYSTEM_MESSAGE='You are a personal assistant.'
  • 302.AI

An AI aggregation platform, it has a shell GPT API and other models. Click here to Add API, after adding, configure the API KEY in .env as follows, and the MODEL can be configured as needed.

_302AI_API_KEY = 'xxxx'
_302AI_MODEL= 'gpt-4o-mini'

Since OpenAI recharge requires foreign credit cards, the process is cumbersome, mostly needing to get foreign virtual cards, which also incurs fees. This platform allows direct payment via Alipay, making it relatively hassle-free. Register and fill out a questionnaire to receive a $1 credit, subsequent recharges also have fees, users can choose accordingly.

  • Claude

Go to the official website to register and obtain the API KEY for configuration.

# Execute the command below to copy the .env.example file to .env, ignore this step if it already exists
cp .env.example .env
# Edit the .env file and add Claude-related configurations
CLAUDE_API_VERSION = '2023-06-01'
CLAUDE_API_KEY = 'your_API_KEY'
CLAUDE_MODEL = 'claude-3-5-sonnet-latest'
# System persona
CLAUDE_SYSTEM = ''
  • Others (to be practiced) theoretically, any API that uses the OpenAI format can be used; just modify the corresponding api_key, model, and proxy_url in the env file.

Build a Smart WeChat Bot: Integrate DeepSeek, ChatGPT, Kimi, and MoreApplication Scenarios

The application scenarios for WeChat Bots are very diverse. Here are some common application scenarios:

Customer Service:

  • Automatically reply to customer inquiries, providing 24/7 service.

  • Handle common questions, relieving pressure on human customer service.

  • Integrate with CRM systems to provide personalized services.

Marketing:

  • Send customized marketing messages, promotional activities, and discount codes.

  • Automatically push relevant product information based on keywords.

  • Survey market feedback and collect user opinions.

Education and Training:

  • Automatically reply to questions from students or parents.

  • Send course notifications, assignment reminders, and learning materials.

  • Create interactive learning experiences.

Internal Communication in Enterprises:

  • Automate workflows, such as approval processes and reimbursement processes.

  • Send company news, notifications, and meeting reminders.

  • Manage corporate WeChat groups and maintain a good communication environment.

Personal Assistant:

  • Customize personal reminders, such as schedule arrangements and birthday reminders.

  • Automate daily tasks, such as weather forecasts and news summaries.

  • Manage personal social relationships, such as automatically replying to friends’ messages.

E-commerce:

  • Automatically handle order inquiries and logistics tracking.

  • Provide product recommendations to promote sales.

  • Manage membership points and promotional activities.

Community Management:

  • Manage WeChat groups, automatically welcome new members and kick out rule-breaking members.

  • Organize group activities and collect registration information.

  • Share valuable content to increase group activity.

Content Creation and Distribution:

  • Automatically push original content such as articles and videos.

  • Customize content recommendations based on user interests.

Healthcare:

  • Provide health consultations and medication reminders.

  • Make appointment registrations and check physical examination reports.

Entertainment Interaction:

  • Create games, interactive Q&A, and other entertainment activities.

  • Send jokes and fun information to increase user engagement.

Smart Home:

  • Control smart home devices such as lights and temperature adjustments.

  • Send home safety alerts.

These application scenarios can be customized and expanded based on specific needs. The flexibility of WeChat bots makes them suitable for various industries and personal uses. However, it is important to note that when using WeChat bots, one should comply with WeChat’s service terms and relevant laws and regulations.

Build a Smart WeChat Bot: Integrate DeepSeek, ChatGPT, Kimi, and More

Open Source Address

Follow the public account and reply 20250223 to obtain

You Might Also Like:

[Open Source] Zero Intrusion Zero Code Tool: One-Click Generation of Multi-Platform API Documentation, Supports HTML/Markdown, Easy Online Debugging!

[Open Source] Quicksilver Engine Frontend Code Generator – Exclusive for Vue + ElementUI, Seamlessly Matching Backend, Supporting Node.js Versions 21, 18, 14 Development.

[Open Source] Highly Recommended: StreamSpeech – A Versatile Speech Recognition, Translation, and Synthesis Model, Real-Time Offline Performance!

[Open Source] Revolutionizing Music Creation Experience: MusicGPT Strongly Debuts, No Heavy Dependencies, Efficient Local Running of AI Music Generation Model!

[Open Source] Unveiling New Office Efficiency Tool: Workflow System Based on Ruoyi Separation Version, Supporting Enterprise Process Automation!

Add WeChat to join related discussion groups,

Note “Microservice” to join group discussions

Note “Low Open” to join the low open group discussions

Note “AI” to join the AI big data and data governance group discussions

Note “Digital” to join the IoT and digital twin group discussions

Note “Security” to join security-related group discussions

Note “Automation” to join automation operation and maintenance group discussions

Note “Trial” to apply for product trials

Note “Graduation Project” for cooperation information on graduation design

Note “Customization” to customize projects with full source code delivery

Build a Smart WeChat Bot: Integrate DeepSeek, ChatGPT, Kimi, and More

Leave a Comment