diff --git a/readme.md b/readme.md index 769ba75..6af83e2 100644 --- a/readme.md +++ b/readme.md @@ -98,10 +98,34 @@ pub async fn main() { ``` -## Customize with Modules +## Customize by Loading Custom Modules A `Module` is a group of bot objects (eg `Command`) that elevated users can manage through built in `disable` and `enable` commands +Custom `Modules` can be loaded into a new bot with minimum coding : just load the modules and run the bot + +```rust +use forcebot_rs_v2::{custom_mods::{guest_badge, pyramid}, Bot}; + +#[tokio::main] +pub async fn main() { + + /* 1. Create the bot using env */ + let mut bot = Bot::new(); + + /* 2. Load Custom Modules */ + bot.load_module(guest_badge::create_module()).await; + bot.load_module(pyramid::create_module()).await; + + /* 3. Run the bot */ + bot.run().await; + +} +``` + + +## Create your own Custom Modules + Create a custom `Module` by : 1. Defining Functions that create the Custom Bot Objects (eg `Command`) @@ -329,14 +353,11 @@ pub async fn main() { # Crate Rust Documentation -Create Crate documentation +Create `forcebot_rs_v2` Rust Crate documentation -Clean Build Documentation +Documentation - Clean Build & Open in Default Browser ``` -cargo clean && cargo doc +cargo clean && cargo doc --open ``` -Open Crate Doc -``` -cargo doc --open -``` + diff --git a/src/lib.rs b/src/lib.rs index 67e89ac..817caac 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,7 +2,7 @@ //! //! Customize by adding additional bot objects //! -//! ## New Bot +//! # New Bot //! //! Uses Env defined variables to create and run the bot //! @@ -23,10 +23,35 @@ //! ``` //! //! -//! ## Customize with Modules +//! # Customize with Modules //! //! A `Module` is a group of bot objects (eg `Command`) that elevated users can manage through built in `disable` and `enable` commands //! +//! +//! Custom `Modules` can be loaded into a new bot with minimum coding : just load the modules and run the bot +//! +//! ```rust +//! use forcebot_rs_v2::{custom_mods::{guest_badge, pyramid}, Bot}; +//! +//! #[tokio::main] +//! pub async fn main() { +//! +//! /* 1. Create the bot using env */ +//! let mut bot = Bot::new(); +//! +//! /* 2. Load Custom Modules */ +//! bot.load_module(guest_badge::create_module()).await; +//! bot.load_module(pyramid::create_module()).await; +//! +//! /* 3. Run the bot */ +//! bot.run().await; +//! +//! } +//! ``` +//! +//! +//! # Create your own Custom Modules +//! //! Create a custom `Module` by : //! //! 1. Defining Functions that create the Custom Bot Objects (eg `Command`) @@ -98,7 +123,7 @@ //! //! ``` //! -//! ## Simple Debug Listener +//! # Simple Debug Listener //! Bot with a simple listener that listens for all messages and prints in output //! //! ```rust @@ -140,7 +165,7 @@ //! //! ``` //! -//! ## Moderator Reactor +//! # Moderator Reactor //! //! ``` //!