Simple Discord Bot for querying RWR Server status
English | 简体中文
- Install Dependency Packages
pnpm i
- Packing and start-up
Retention file source mapping: use dev command:
pnpm build:dev
# start
node dist/index.js
No retention file source mapping, use release command:
pnpm build:release
# start
node dist/app.js
- After cloning this project, first install the dependency package
pnpm i
- Packing and start-up:
npm run start
Based on the .env-example
file, write your own .env
file with the following variable descriptions:
- APP_ID: Your bot's application id
- GUILD_ID: The id of the server where your bot is located
- DISCORD_TOKEN: Your bot's token
- PUBLIC_KEY: Your bot's public Key
- SERVER_MATCH_REGEX: Match the name of the RWR server you want to query with this regular
- DATA_FOLDER: The data file storage directory, usually
data
, is then mounted in the same directory as/app/data
Prepare the required files for the data directory
data/map_db.json
: Referencemap_db_example.json
, providing map order information filedata/tdoll_db.json
: By cloning this project, execute the commandnpm run updatedb
, get thetdoll_db.json
file, and move it todata/tdoll_db.json
Preparation:
- Prepare the required files for the data directory:
data/map_db.json
: Referencemap_db_example.json
, providing map order information filedata/tdoll_db.json
: By cloning this project, execute the commandnpm run updatedb
, get thetdoll_db.json
file, and move it todata/tdoll_db.json
-
Create an empty logs folder
-
Prepare environment variable information
- APP_ID: Your bot' application id
- GUILD_ID: The id of the server where your bot is located
- DISCORD_TOKEN: Your bot's token
- PUBLIC_KEY: Your bot's public Key
- SERVER_MATCH_REGEX: Match the name of the RWR server you want to query with this regular
- DATA_FOLDER: The data file storage directory, usually
data
, is then mounted in the same directory as/app/data
- Start using one of the following methods:
- PM2
- Docker
- Docker compose
- Packing
pnpm i
pnpm build:dev
- Deployment
pm2 start --name rwr-discord-bot dist/index.js
Specify environment variables with -e
and mount the data directory with -v
docker run --name rwr-discord-bot \
-e "APP_ID=<APP_ID>" \
-e "GUILD_ID=<GUILD_ID>" \
-e "DISCORD_TOKEN=<DISCORD_TOKEN>" \
-e "PUBLIC_KEY=<PUBLIC_KEY>" \
-e "SERVER_MATCH_REGEX=<SERVER_MATCH_REGEX>" \
-e "DATA_FOLDER=data" \
-v ${PWD}/data:/app/data \
-v ${PWD}/logs:/app/logs \
-d zhaozisong0/rwr-discord-bot:latest
Start by writing the .env
file (refer to .env-example
) and the docker-compose.yaml
file (refer to docker-compose-example.yaml
)
Use the following command to start:
docker-compose up -d
Use the following command to stop:
docker-compose down