- Text chat with ChatGPT in WeChat
- Support 1v1 chat or mention(@) in group
- Daily token statistics and limits
- Monitoring (to prevent accounts from going offline sometimes)
Notice: the following tool should available in your computer Redis PM2 PNPM Node.js v20
- Create
.env
from.env.example
, configOPENAI_API_KEY
,POSTGRES_URL
in.env
- If database is not initialized, run
pnpm db
to init postgres db. (you can use local postgres or remote serverless postgres) - Install dependencies
pnpm install
- Run
pnpm dev
Notice: the following tool should available in your server Redis PM2 PNPM Node.js v20
- If database is not initialized, run
pnpm db
in you local computer to init postgres db. (you can use local postgres or remote serverless postgres) - Run
pnpm build
, all assets are in thedist
folder - Deploy
dist
to your server- Use
tools/deploy.sh
- You need to set env SSH_KEY, SRC, DIST
- SRC: your
dist
folder path in your local computer - DIST: the dest endpoint:folder in your server. e.g.
username@xxx.xxx.xxx.xxx:/home/user/wechat-bot
- SRC: your
- Use
- ssh to your server and run
pnpm install --production
- create
.env
from.env.example
, configOPENAI_API_KEY
,POSTGRES_URL
,MAX_TOKEN_COUNT_PER_DAY
in.env
- create
pm2.config.json
frompm2.config.json.example
pm2 start pm2.config.json
- Bind a domain for this service
- use a monitor service like https://uptime.betterstack.com/ or https://uptimerobot.com/