-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use feature flags instead of command line arguments (#23)
- Loading branch information
Showing
19 changed files
with
198 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Custom | ||
A user-friendly Discord bot that simplifies server management, automates tasks, and enhances engagement. Enjoy seamless moderation, level-based rewards, and a straightforward setup process. | ||
## Compilation | ||
```bash | ||
cargo build --release --features all | ||
./target/release/custom | ||
``` | ||
## Feature flags | ||
Everything that is separated by feature flags can be run separately from processes with other features, as long as they are connected to the same MongoDB and Redis databases. | ||
|
||
| Name | Description | | ||
| ------------------- |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| `all` | Enables all the feature flags listed below | | ||
| `custom-bots` | Listens for events on bot accounts set by users | | ||
| `gateway` | Listens for events on a main account ([Gateway connection]([https://discord.com/developers/docs/topics/gateway#connections](https://discord.com/developers/docs/topics/gateway#connections))) | | ||
| `http-interactions` | Runs HTTP server on port 80 that listen for interactions sent by discord ([Receiving interactions]([https://discord.com/developers/docs/interactions/receiving-and-responding#receiving-an-interaction](https://discord.com/developers/docs/interactions/receiving-and-responding#receiving-an-interaction))) | | ||
| `tasks` | Runs tasks scheduler (handles actions like removing roles from temporary muted users) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
fn main() { | ||
#[cfg(not(feature = "http-interactions"))] | ||
#[cfg(not(feature = "custom-clients"))] | ||
#[cfg(not(feature = "gateway"))] | ||
#[cfg(not(feature = "tasks"))] | ||
{ | ||
eprintln!("You need to specify features before compiling code\n\tTo compile everything try using `cargo build --features all`"); | ||
std::process::exit(1); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
#[cfg(any(feature = "tasks", feature = "custom-clients"))] | ||
pub mod clients; | ||
#[cfg(any(feature = "gateway", feature = "custom-clients"))] | ||
pub mod shard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.