p4bl0t/README.md
Lucien Cartier-Tilet 58cbde4cef feat: dockerize p4bl0t
This commit removes DATABASE_URL variable in favour of a fixed name.
The project won’t panic anymore if this variable isn’t set. This
removes the need for dotenvy.

It also adds the necessary files to dockerize the application.

Update instructions in README on how to run the project.

Add possibility to compile the project without a database available.

Closes #8
2024-01-18 22:25:35 +00:00

60 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# p4bl0t
p4bl0t is a simple logging bot for Discord written in Rust.
## Usage
### Preparation
In order to run p4bl0t, you will need a Discord token with which your
bot will authenticate. Head over to your [developer
portal](https://discord.com/developers) on Discords website, and
create a bot there. You will be able to get the bots token there.
### Docker
The easiest way to run p4bl0t is using Docker. Copy
`docker-compose.example.yml` to `docker-compose.yml` and modify the
`DISCORD_TOKEN` variable.
Then, you can simply run
```sh
docker compose up # or docker-compose on some machines
```
### Building and running it yourself
Copy the `.env.example` file to a `.env` file and fill in the details.
```sh
cp .env.example .env
emacs .env
# or
vim .env
# or
nano .env
# or
code .env
# or whichever text editor you prefer
```
Install the sqlx CLI if you dont have it already.
```sh
cargo install sqlx-cli
```
Setup your SQLite database.
```sh
sqlx database create
sqlx migrate run
```
You can then run the project using `cargo run`
```sh
cargo run
# or
cargo run --release # if you dont want debug symbols
```
## Contributing
Pull requests are welcome. For major changes, please open an issue
first to discuss what you would like to change.
## License
[AGPL-3.0 or later](./LICENSE.md)