A WeChat robot based on wechatbot-webhook, supporting GPT Q&A, hot search push, weather forecast, message forwarding, mini games, Webhook reminder and other functions.
WeChatter supports Docker Compose deployment, Docker deployment and local deployment.
Tip
It is recommended to use Docker-compose for deployment.
mkdir WeChatter && cd WeChatter
wget -O config_cps.yaml https://cdn.jsdelivr.net/gh/cassius0924/wechatter@master/config_cps.yaml.example
config_cps.yaml
configuration file vim config_cps.yaml
wget https://cdn.jsdelivr.net/gh/cassius0924/wechatter@master/docker-compose.yml
docker-compose -f docker-compose.yml up
Use WeChat to scan the QR code output from the terminal to log in to WeChat.
Use another WeChat account to try to pat the robot or send the /help
command to the robot.
Tip
For command help, please use the /help
command to query or view the command function display.
Offline reminder : When the robot goes offline, a reminder message will be pushed through Bark.
Messages can be quoted and replied : Users can further obtain message content by quoting and replying to command messages. Bot messages with (可引用:***)
are quoteable messages that can be further interacted with.
Message forwarding : Forward messages from a user or group to other users or groups, and support quote reply forwarding messages. Configuration is required.
Public account reminder : When the designated public account publishes a new article, the robot will send a reminder to the designated user or group. Configuration is required.
Scheduled tasks : Most commands support scheduled tasks. Configuration is required.
Discord message forwarding : Based on Discord Webhook, forward WeChat messages to Discord channels. Configuration is required.
Tip
For help with game-related commands, please use View Basic Game Commands.
config.yaml.example
in the project root directory is the configuration file template. Before starting the project for the first time, you need to copy a configuration file and name it config.yaml
. Edit config.yaml
.
The following table explains the configuration items:
Configuration items | explain | Remark |
---|---|---|
wechatter_port | The port of the WeChatter server, the port for receiving messages | The default is 4000 , which must be consistent with the port of the RECV_MSG_API parameter of wxbotwebhook Docker |
Configuration items | explain | Remark |
---|---|---|
wx_webhook_base_api | BaseAPI for sending messages | The default is http://localhost:3001 , which is the address of wxBotWebhook Docker. The default value for Docker Compose deployment is http://wxbotwebhook:3001 |
wx_webhook_recv_api_path | Interface path for receiving messages | The default is /receive_msg , this path is the path of the Docker parameter RECVD_MSG_API |
wx_webhook_token | Token of wxBotWebhook | Docker Compose defaults to wechatter when deployed |
Configuration items | explain | Remark |
---|---|---|
admin_list | Set up an administrator to receive robot status change notifications | Fill in the administrator’s WeChat name (not remarks) |
admin_group_list | Similar to admin_list , receive robot status change notifications | Fill in the group name (not group remarks) |
bark_url | Bark URL for receiving robot status change notifications | Bark is only available on iOS and iPadOS |
Configuration items | explain | Remark |
---|---|---|
bot_name | WeChat robot name | WeChat name, not WeChat ID |
Configuration items | explain | Remark |
---|---|---|
command_prefix | Robot command prefix | The default is / , which can be set to any character such as >> , ! etc., and can be empty. When this item is empty, the command prefix is not required to trigger the command. |
need_mentioned | Do commands in group chat require @bot? | Default is False |
ban_person_list | Blacklist user list | Bots will not respond to messages from blacklisted users |
ban_group_list | Blacklist group list | Bots will not respond to messages from blacklisted groups |
Configuration items | explain | Remark |
---|---|---|
openai_base_api | BaseAPI of OpenAI service | Default is https://api.openai.com |
openai_token | OpenAI Token(Key) | String key starting with sk_ |
Access method: iFlytek Spark Model - AI Large Language Model - Spark Model - iFlytek
Configuration items | explain | Remark |
---|---|---|
spark_api | BaseAPI of Spark Big Model Service | The default is https://spark-api-open.xf-yun.com/v1/chat/completions |
spark_model | Specify the model version to access | lite points to the Lite version; 4.0Ultra points to the 4.0 Ultra version; |
spark_token | Token of Spark Large Model | string key |
Access method: https://console.x.ai/
Configuration items | explain | Remark |
---|---|---|
grok_api | BaseAPI for Grok service | Default is https://api.x.ai/v1/chat/completions |
grok_model | Specify the model version to access | Default is grok-beta |
grok_token | Grok's Token | string key |
Configuration items | explain | Remark |
---|---|---|
github_webhook_enabled | Function switch, whether to accept GitHub Webhook | Default is False |
github_webhook_api_path | Receive the interface path of GitHub Webhook | Default is /webhook/github |
github_webhook_receiver_list | WeChat users who receive GitHub Webhook | |
github_webhook_receive_group_list | Receive GitHub Webhook WeChat group |
Configuration items | child | explain | Remark |
---|---|---|---|
message_forwarding_enabled | Function switch, whether to enable message forwarding | Default is False | |
message_forwarding_rule_list | List of message rules, each rule contains four fields: from_list , from_list_exclude , to_person_list and to_group_list | ||
from_list | List of message forwarding sources, that is, the message sender | You can fill in multiple user names or group names. If you want to forward all messages, use ["%ALL"] | |
from_list_exclude | Message forwarding source exclusion list, users and groups in this list will not be forwarded | It only takes effect when from_list is ["%ALL"] | |
to_person_list | Message forwarding target user list, that is, the message receiving user | You can fill in multiple user names or an empty list | |
to_group_list | Message forwarding target group list, that is, message receiving group | You can fill in multiple group names or an empty list |
Configuration items | child | explain | Remark |
---|---|---|---|
official_account_reminder_enabled | Function switch, whether to enable message forwarding | Default is True | |
official_account_reminder_rule_list | List of message rules, each rule contains three fields: oa_name_list , to_person_list and to_group_list | ||
oa_name_list | Official account name list | You can fill in multiple official account names | |
to_person_list | List of message forwarding target users, that is, message receiving users | You can fill in multiple user names or an empty list | |
to_group_list | Message forwarding target group list, that is, message receiving group | You can fill in multiple group names or an empty list |
Configuration items | explain | Remark |
---|---|---|
all_task_cron_enabled | Master switch for all scheduled tasks | Default is True |
task_cron_list | Scheduled task list, each task contains four fields: task , enabled , cron and commands |
For details on scheduled task configuration, please refer to Scheduled Task Configuration Details.
Configuration items | explain | Remark |
---|---|---|
custom_command_key_dict | Custom command keyword dictionary, the format is command: [key1, key2, ...] , where command is the command name, key1 and key2 are custom command keywords |
For the optional values of the command name, please refer to the custom command keyword configuration details.
Configuration items | child | explain | Remark |
---|---|---|---|
discord_message_forwarding_enabled | Function switch, whether to enable Discord message forwarding | Default is False | |
discord_message_forwarding_rule_list | List of message rules, each rule contains three fields: from_list , to_discord_webhook_url and to_discord_webhook_name | ||
from_list | List of message forwarding sources, that is, the message sender | You can fill in multiple user names or group names. If you want to forward all messages, use ["%ALL"] | |
from_list_exclude | Message forwarding source exclusion list, users and groups in this list will not be forwarded | It only takes effect when from_list is ["%ALL"] | |
discord_webhook_url | Message forwarding target Discord Webhook URL |
Configuration items | explain | Remark |
---|---|---|
gpt_mode_person_list | Default user list for GPT Q&A mode | That is, messages with command keywords will trigger the corresponding commands normally, and other messages are judged to be GPT commands. |
gpt_model | Default GPT Q&A model | Optional values are gpt35 , gpt4 |
Log files are stored in the logs/
folder in the project root directory.
The default logging level is INFO
, and the optional logging level values are DEBUG
, INFO
, WARNING
, ERROR
, and CRITICAL
.
If you need to adjust the logging level, please modify the WECHATTER_LOG_LEVEL
environment variable in the docker-compose.yml
file.
Please modify the WECHATTER_LOG_LEVEL
environment variable in the docker run
command.
Please modify the system environment variable WECHATTER_LOG_LEVEL
.
export WECHATTER_LOG_LEVEL=DEBUG
Thanks to the following people who have contributed to this project:
Note
Under development...
Warning
This project is still under development, and suggestions and comments are welcome.