Mobile wallpaper
175 字
1 分钟

GPT接入微信公众号

github项目地址
https://github.com/zhayujie/bot-on-anything

步骤命令
进入opt文件夹cd /opt
更新软件库apt update
克隆代码git clone https://github.com/zhayujie/bot-on-anything
进入文件夹cd bot-on-anything
复制配置文件cp config-template.json config.json
安装pip3apt-get install python3-pip
安装chatGPT依赖pip3 install --upgrade openai
个人订阅号依赖pip3 install werobot
web依赖pip3 install PyJWT flask
进入项目文件夹cd /opt/bot-on-anything
启动python3 /opt/bot-on-anything/app.py
后台启动cd /opt/bot-on-anything && nohup python3 /opt/bot-on-anything/app.py > /opt/bot-on-anything/nohup.log 2>&1 &
查询进程IDps -ef | grep 'python3 /opt/bot-on-anything/app.py'

创建开机启动

vim /etc/systemd/system/bot-on-anything.service

填入内容

[Unit]
Description=Bot on Anything
After=network.target
[Service]
User=root
WorkingDirectory=/opt/bot-on-anything
ExecStart=/usr/bin/python3 /opt/bot-on-anything/app.py
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=bot-on-anything
[Install]
WantedBy=multi-user.target

重新加载 Systemd 配置文件

systemctl daemon-reload

启动服务

systemctl start bot-on-anything

查看服务

systemctl status bot-on-anything

开机自启

systemctl enable bot-on-anything
GPT接入微信公众号
https://www.pidexe.com/posts/bot_on_anything/
作者
fang523
发布于
2025-12-01
许可协议
CC BY-NC-SA 4.0

目录