chore: strip bot model from quark

This commit is contained in:
Paul Makles
2023-08-14 10:14:17 +01:00
parent 2fb9e7a802
commit bde432cb75
12 changed files with 6 additions and 180 deletions

View File

@@ -21,7 +21,6 @@ mod servers {
}
mod users {
pub mod bot;
pub mod user;
pub mod user_settings;
}
@@ -45,7 +44,6 @@ pub use servers::server::AbstractServer;
pub use servers::server_ban::AbstractServerBan;
pub use servers::server_member::AbstractServerMember;
pub use users::bot::AbstractBot;
pub use users::user::AbstractUser;
pub use users::user_settings::AbstractUserSettings;
@@ -65,7 +63,6 @@ pub trait AbstractDatabase:
+ AbstractServer
+ AbstractServerBan
+ AbstractServerMember
+ AbstractBot
+ AbstractUser
+ AbstractUserSettings
+ AbstractReport

View File

@@ -1,26 +0,0 @@
use crate::models::bot::{Bot, FieldsBot, PartialBot};
use crate::Result;
#[async_trait]
pub trait AbstractBot: Sync + Send {
/// Fetch a bot by its id
async fn fetch_bot(&self, id: &str) -> Result<Bot>;
/// Fetch a bot by its token
async fn fetch_bot_by_token(&self, token: &str) -> Result<Bot>;
/// Insert new bot into the database
async fn insert_bot(&self, bot: &Bot) -> Result<()>;
/// Update bot with new information
async fn update_bot(&self, id: &str, bot: &PartialBot, remove: Vec<FieldsBot>) -> Result<()>;
/// Delete a bot from the database
async fn delete_bot(&self, id: &str) -> Result<()>;
/// Fetch bots owned by a user
async fn fetch_bots_by_user(&self, user_id: &str) -> Result<Vec<Bot>>;
/// Get the number of bots owned by a user
async fn get_number_of_bots_by_user(&self, user_id: &str) -> Result<usize>;
}