|
4 | 4 |
|
5 | 5 | # Λύρα
|
6 | 6 |
|
7 |
| -[](https://github.com/lyra-music/lyra/actions/workflows/ci.yml) |
8 |
| -[](https://github.com/lyra-music/lyra/releases/latest) |
9 |
| -[](https://discord.gg/d4UerJpvTp) |
10 |
| -[](https://www.codefactor.io/repository/github/lyra-music/lyra) |
| 7 | +[](https://builtwithnix.org) |
| 8 | +[](https://discord.gg/d4UerJpvTp) |
| 9 | +[](https://www.codefactor.io/repository/github/lyra-music/lyra) |
| 10 | +[](https://github.com/lyra-music/lyra/actions/workflows/ci.yml) |
| 11 | +[](https://github.com/lyra-music/lyra/releases/latest) |
| 12 | + |
11 | 13 |
|
12 | 14 | A *self-hostable* **Discord music bot**, focused on *fairness*.
|
13 | 15 |
|
14 | 16 | > [!NOTE]
|
15 |
| -> This project is actively developed with a focus on maintaining stability. |
16 |
| -> Users are encouraged to self-host and test the bot locally. |
17 |
| -> Core functionality is implemented, though some features like queue viewing and polling systems for command fairness are still in development. |
| 17 | +> Λύρα is actively developed with a strong focus on maintaining stability. |
| 18 | +> Core functionality is fully implemented, but some features (e.g., queue visualisation, command fairness polls) are still under development. |
| 19 | +> Users are encouraged to self-host and test locally. |
| 20 | +
|
| 21 | +--- |
18 | 22 |
|
19 | 23 | ## Setup
|
20 | 24 |
|
21 |
| -Start by copying the example environment file: |
| 25 | +Start by creating your environment configuration: |
22 | 26 |
|
23 | 27 | ```console
|
24 | 28 | $ cp .env.example .env
|
25 | 29 | ```
|
26 | 30 |
|
27 |
| -Then, edit the `.env` file to set your environment variables. The file contains comments to guide you. At a minimum you should provide a valid `BOT_TOKEN`, database credentials, and lavalink credentials. |
| 31 | +Edit `.env` and provide the required values: |
| 32 | +- `BOT_TOKEN` (Discord bot token) |
| 33 | +- Database credentials |
| 34 | +- Lavalink credentials |
| 35 | + |
| 36 | +Comments in the file will guide you through the configuration. |
| 37 | + |
| 38 | +--- |
28 | 39 |
|
29 |
| -### Docker |
| 40 | +### Running |
30 | 41 |
|
31 |
| -The easiest way to set up Λύρα is to use Docker. Start by creating a copy of the example docker compose file: |
| 42 | +The easiest way to run Λύρα is via Docker. Begin by copying the example Compose file: |
32 | 43 |
|
33 | 44 | ```console
|
34 | 45 | $ cp compose.example.yaml compose.yaml
|
35 | 46 | ```
|
36 | 47 |
|
37 |
| -In addition, you need to set `DOCKER_POSTGRES_PATH` and `DOCKER_LAVALINK_PLUGINS_PATH` environment variables in `.env` to point to two empty directories you want to use for the database and plugins respectively. You can create them with: |
| 48 | +Next, set up two directories for persistent storage (PostgreSQL data and Lavalink plugins) and update your `.env`: |
38 | 49 |
|
39 | 50 | ```console
|
40 | 51 | $ mkdir -p /path/to/your/database
|
41 | 52 | $ mkdir -p /path/to/your/plugins
|
42 | 53 | # chown -R 322:322 /path/to/your/plugins
|
43 | 54 | ```
|
44 | 55 |
|
| 56 | +Update `.env`: |
| 57 | + |
45 | 58 | ```dotenv
|
46 |
| -# File: .env |
47 | 59 | DOCKER_POSTGRES_PATH=/path/to/your/database
|
48 | 60 | DOCKER_LAVALINK_PLUGINS_PATH=/path/to/your/plugins
|
49 | 61 | ```
|
50 | 62 |
|
51 |
| -Then, run the following command to start the bot and the database: |
| 63 | +Start the bot and services: |
52 | 64 |
|
53 | 65 | ```console
|
54 | 66 | # docker compose up -d
|
55 | 67 | ```
|
56 |
| -This will start the bot and its associated services in detached mode and run them in the background. To check the logs, run: |
57 | 68 |
|
58 |
| -```console |
59 |
| -# docker compose logs -f |
60 |
| -``` |
| 69 | +- View logs: |
| 70 | + ```console |
| 71 | + # docker compose logs -f |
| 72 | + ``` |
| 73 | +- Stop services: |
| 74 | + ```console |
| 75 | + # docker compose down |
| 76 | + ``` |
61 | 77 |
|
62 |
| -To stop the bot, run: |
| 78 | +--- |
63 | 79 |
|
64 |
| -```console |
65 |
| -# docker compose down |
66 |
| -``` |
67 |
| - |
68 |
| -### Nix (For Development) |
| 80 | +### Development |
69 | 81 |
|
70 |
| -Start by entering the development shell: |
| 82 | +If you're using [`nix-direnv`](https://github.com/nix-community/nix-direnv), enter the dev shell automatically; otherwise, run: |
71 | 83 |
|
72 | 84 | ```console
|
73 |
| -$ nix develop --impure |
| 85 | +$ nix develop --no-pure-eval |
74 | 86 | ```
|
75 | 87 |
|
76 |
| -This will also download all the dependencies and set up the environment. To start the services required for the bot to function, run: |
| 88 | +This sets up all dependencies. Then, start the required services: |
77 | 89 |
|
78 | 90 | ```console
|
79 | 91 | $ devenv up -D
|
80 | 92 | ```
|
81 | 93 |
|
82 |
| -To check the logs, run: |
83 |
| -```console |
84 |
| -$ process-compose attach |
85 |
| -``` |
| 94 | +- Attach to logs: |
| 95 | + ```console |
| 96 | + $ process-compose attach |
| 97 | + ``` |
| 98 | +- Stop services: |
| 99 | + ```console |
| 100 | + $ process-compose down |
| 101 | + ``` |
| 102 | +- Run the bot: |
| 103 | + ```console |
| 104 | + $ cargo run --release |
| 105 | + ``` |
86 | 106 |
|
87 |
| -To stop these services, run: |
| 107 | +--- |
88 | 108 |
|
89 |
| -```console |
90 |
| -$ process-compose down |
91 |
| -``` |
92 |
| - |
93 |
| -To start the bot, run: |
94 |
| - |
95 |
| -```console |
96 |
| -$ cargo run --release |
97 |
| -``` |
98 |
| - |
99 |
| -### Manual (Not recommended) |
| 109 | +### Manual Setup (Not Recommended) |
100 | 110 |
|
101 |
| -If you want to set up the bot manually, you need to install the following dependencies: |
| 111 | +To set up manually, install: |
102 | 112 |
|
103 |
| -- [`Rust`](https://www.rust-lang.org/tools/install) |
104 |
| -- [`PostgreSQL`](https://www.postgresql.org/download/) |
105 |
| -- [`Lavalink`](https://lavalink.dev/getting-started/index.html) |
| 113 | +- [Rust](https://www.rust-lang.org/tools/install) |
| 114 | +- [PostgreSQL](https://www.postgresql.org/download/) |
| 115 | +- [Lavalink](https://lavalink.dev/getting-started/index.html) |
106 | 116 |
|
107 |
| -Follow the official documentation on how to set up and configure these tools. |
108 |
| - |
109 |
| -Then, clone the repository and run the following command: |
| 117 | +Follow their official documentation for configuration. Then: |
110 | 118 |
|
111 | 119 | ```console
|
112 | 120 | $ cargo run --release
|
113 | 121 | ```
|
114 | 122 |
|
| 123 | +--- |
| 124 | + |
115 | 125 | ## Attributions
|
116 | 126 |
|
117 |
| -- [`twilight-rs`](https://twilight.rs/) - Powerful, flexible, and scalable ecosystem of Rust libraries for the Discord API. |
118 |
| -- [`Lavalink`](https://lavalink.dev/) - Standalone audio sending node based on Lavaplayer. |
119 |
| - - [`lavalink-rs`](https://gitlab.com/vicky5124/lavalink-rs/) - Lavalink bindings for asynchronous rust discord libraries. |
| 127 | +- [twilight-rs](https://twilight.rs/) - Scalable Rust libraries for Discord API. |
| 128 | +- [Lavalink](https://lavalink.dev/) - Standalone audio node based on Lavaplayer. |
| 129 | + - [lavalink-rs](https://gitlab.com/vicky5124/lavalink-rs/) - Async Lavalink bindings for Rust Discord libraries. |
0 commit comments