in ,

XYBot: A powerful WeChat robot deployment tutorial


🌟Imagine having an all-powerful WeChat robot that can help you check the weather, find news, and even chat with you. This is no longer a dream! XYBot, a WeChat robot based on docker and pywxdll hook injection technology, makes your WeChat life more interesting and convenient! 🎉

project address:https://github.com/HenryXiaoYang/XYBot

Development documentation:https://henryxiaoyang.github.io/XYBot/#/

🌈XYBot’s powerful features at a glance:

🌤️Weather forecast: Want to know what to wear when going out tomorrow? XYBot provides you with the latest weather information at any time.

📰News Flash: Missed important news? XYBot helps you keep track of global trends.

🗣️ChatGPT conversation: When you are bored, start an in-depth artificial intelligence conversation with XYBot.

🎮Hypixel Query: Gaming fan? XYBot helps you query Hypixel player information.

📸Random pictures: Want something new? XYBot sends you random pictures.

🔗Practical links: Can’t find information for study or work? XYBot is here to help.

🤝Interesting facts about group friends: Randomly select a group friend and discover more surprises.

✅Daily Check-in: Stay active, XYBot records your every day.

📊 Points system: Participate in interaction, accumulate points, and have endless fun.

🏆Points list: See who is the points expert.

💰Point transfer: Share happiness and transfer points.

🎁Points Lottery: Use points to try your luck and get surprises one after another.

🧧Points red envelopes: In a festive atmosphere, use points to send red envelopes, which warms people's hearts.

🛠️Good news for managers:

💰Points adjustment: Administrators can freely adjust points.

📝Whitelist settings: Protect important users and ensure security.

🔄Status reset: Reset sign-in with one click, convenient and fast.

📚Contact list viewing: Easily obtain robot contact information.

🤝Group member management: Get the group member list to make management easier.

🔄Plug-in operation: hot loading, unloading, reloading, plug-in management as you like.

💡Not only that, XYBot also supports self-written plug-ins, releasing your creativity and making the robot more personalized and powerful! 🚀

💻Deploy XYBot:

1.🚀Docker deployment

docker run --name xybotwechat \
    -e HOOK_PROC_NAME=WeChat \
    -e HOOK_DLL=auto.dll \
    -e TARGET_AUTO_RESTART="yes" \
    -e INJ_CONDITION="( \"\`sudo netstat -tunlp | grep 5555\`\" != '' ) && exit 0 ; sleep 5 ; curl 'http://127.0.0.1:8680/hi' 2>/dev/null | grep -P 'code.:0'" \
    -e TARGET_CMD=wechat-start \
    -p 4000:8080 -p 5555:5555 -p 5900:5900 \
    --add-host=dldir1.qq.com:127.0.0.1 \
    chisbread/wechat-service:latest

2.🐧Enter XYBot VNC

Open http://:4000/vnc.html in the browser, and then install the following steps:

Click to connect

Scan the QR code to log in to WeChat

Right-click on the desktop–>Application–>Shells–>click Bash

3.📁Clone code

git clone https://github.com/HenryXiaoYang/XYBot.git

#如果上面的太慢的话可以用下面这个:
git clone https://kkgithub.com/HenryXiaoYang/XYBot.git

4.📦Install dependencies

# 无镜像,在国内很慢
python3 get-pip.py

# 如果上面的太慢的话可以用下面这个:
python3 get-pip.py -i https://pypi.tuna.tsinghua.edu.cn/simple

After installing pip, you can install the dependencies:

# 设置默认使用清华源镜像,以后就不用再调了
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

# 切换到XYBot目录中
cd XYBot

# 装XYBot所需要的库
pip3 -r requirements.txt

# 如果以后装的新插件需要其他库,请自行安装

5.🚀Start the robot:

python3 start.py

⚙️Set Admin
First send a message to the robot and then press control+c to interrupt the operation. As you can see from the picture, there are keys called 'id1' and 'wxid' in the received message. If you send a private message to the robot, please remember the value of 'wxid'; if you send it to a group, please remember the value of 'id1'.

Then modify the configuration:

vi main_config.yml

Change it to the following, add the value of id1 obtained above to admins, and you can set up the administrator.

#Version 0.0.5
bot_version: "v0.0.5"

#如果不知道自己在干什么请别动这两行
ip: 127.0.0.1
port: 5555

admins: ( "wxid_123456789" )

max_worker: 25

command_prefix: "https://unsafe.sh/" #如果需要前缀,则必须为一个字符  如果不需要前缀可设置为空,即 ""

excluded_plugins: ( "" )

timezone: "Asia/Shanghai"

Then restart the robot:

python3 start.py

🚗Modify plugin settings

Switch to the plugins directory in the XYBot directory

cd plugins

# 看看有哪些文件
ls
__pycache__                 menu.py
admin_points.py             menu.yml
admin_points.yml            news.py
admin_signin_reset.py       news.yml
admin_signin_reset.yml      points_leaderboard.py
admin_whitelist.py          points_leaderboard.yml
admin_whitelist.yml         points_trade.py
bot_status.py               points_trade.yml
bot_status.yml              query_points.py
get_chatroom_memberlist.py  query_points.yml
get_chatroom_memberlist.yml random_group_member.py
get_contact_list.py         random_group_member.yml
get_contact_list.yml        random_picture.py
gpt.py                      random_picture.yml
gpt.yml                     random_picture_link.py
gpt4.py                     random_picture_link.yml
gpt4.yml                    red_packet.py
hypixel_info.py             red_packet.yml
hypixel_info.yml            sign_in.py
lucky_draw.py               sign_in.yml
lucky_draw.yml              weather.py
manage_plugins.py           weather.yml
manage_plugins.yml

Each plug-in has its own configuration file. Please configure it one by one according to your own needs (only individual plug-ins need to be configured, such as those related to ChatGPT, where the api key needs to be filled in). Here is a gpt demonstration. You need to modify openai_api_base and openai_api_key.
Fill in the api link in the double quotes of openai_api_base. The official OpenAI is https://api.openai.comfill in the api key in the double quotes of openai_api_key:

keywords: ("智能聊天")
plugin_name: "gpt"

#ChatGPT的API网址
openai_api_base: "https://api.openai.com"
#ChatGPT API的Key
openai_api_key: "sk-*************"

gpt_point_price: 3

gpt_version: 'gpt-3.5-turbo'
gpt_max_token: 1000
gpt_temperature: 0.5

Finally, let’s talk about how to set the VNC password. If you want to publish the service to the public network, do not set a password.

  • Find out the CONTAINER ID of the XYBot container in the terminal docker ps
  • Execute docker exec -it (CONTAINER ID of XYBot container) /bin/sh
  • Execute x11vnc –storepasswd within the container
  • Then follow the prompts to set a password
  • Edit this file /etc/supervisord.d/x11vnc.conf
  • Add -rfbauth /home/app/.vnc/passwd at the end of command=x11vnc -forever -shared in the second line
  • The last step should be command=x11vnc -forever -shared -rfbauth /home/app/.vnc/passwd
  • Exit docker and then restart docker
  • Now you need to enter a password to connect to vnc using the web page

Now, you only need to follow the above steps to have an XYBot of your own, making smart life within reach! 🎊

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings

Microsoft expands Copilot for Microsoft 365 for enterprises with 16 new language support

The FCC imposes $200 million in fines on four US carriers for unlawfully sharing user location data