doc adj for modules
This commit is contained in:
parent
34842d4c41
commit
2a6b512ce1
2 changed files with 58 additions and 12 deletions
37
readme.md
37
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
|
||||
```
|
||||
|
||||
|
|
33
src/lib.rs
33
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
|
||||
//!
|
||||
//! ```
|
||||
//!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue