Skip to content

craftserverbot/craftserver

Repository files navigation

CraftServer Discord bot

Environment Setup

Install Rust, Git, and PostgreSQL. Then install sqlx-cli and cross:

cargo install sqlx-cli --no-default-features --features native-tls,postgres
cargo install cross --git https://github.com/cross-rs/cross

Add the database URL to .env:

#                       username password hostname  database
DATABASE_URL=postgres://postgres:postgres@localhost/postgres

Now, run SQLX to create the database and run migrations:

cd packages/bot

sqlx database setup
# OR just run migrations
# sqlx migrate run

cargo sqlx prepare

Compiling

Use cargo run during development. When ready to deploy, run ./deploy.sh to compile CraftServer in release mode, back up the database, upload the binary to the server, and restart the bot.

The deploy script will ask to make a Git tag, but that can be skipped by hitting return. Run ./deploy.sh -h for a full list of options.

About

View live information about your favorite Minecraft servers, right from Discord.

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •