Skip to content

Commit a2f2cab

Browse files
committed
docs(Bot): add documentation for bot module
1 parent 4bbb2e4 commit a2f2cab

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/bot/event.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ use serenity::{
1111

1212
use crate::server::Server;
1313

14+
/// Struct for handling `Discord` events.
15+
///
16+
/// It currently handles `Ready`, `GuildCreate` and `GuildDelete` events.
1417
pub struct Handler;
1518
impl Handler {
1619
pub const fn new() -> Self { Self }

src/bot/mod.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
//! Main module for the bot.
2+
//!
3+
//! This module contains the main struct for the bot, which is `Bot`. It also
4+
//! handles everything related to discord except music. For music see
5+
//! [`Player`].
6+
//!
7+
//! [`Player`]: crate::music::Player
8+
19
mod commands;
210
mod event;
311

@@ -8,12 +16,17 @@ use songbird::SerenityInit;
816

917
pub use crate::bot::commands::Context;
1018

19+
/// The main struct for the bot.
20+
///
21+
/// Every interaction with `Discord` is done through this struct.
1122
#[non_exhaustive]
1223
pub struct Bot;
1324

1425
impl Bot {
26+
/// Creates a new instance of the bot.
1527
pub const fn new() -> Self { Self }
1628

29+
/// Runs the bot.
1730
pub async fn run(&mut self) {
1831
#[cfg(feature = "database")]
1932
get_config!()

0 commit comments

Comments
 (0)