refactor: simplify code, better organize it, and comment it

This commit is contained in:
2023-11-25 22:01:02 +01:00
parent 75cd5dd7cb
commit d6b208963d
11 changed files with 303 additions and 130 deletions

View File

@@ -6,6 +6,14 @@ pub struct BotData {
}
impl BotData {
/// Initialize state data for bot.
///
/// For now, this only includes a connector to its database.
///
/// # Errors
///
/// This function will return an error if the database fails to
/// initialize.
pub async fn new() -> color_eyre::Result<Self> {
Ok(Self {
database: Database::new().await?,