feat: start work on migrating routes

This commit is contained in:
Paul Makles
2023-08-03 22:11:48 +01:00
parent a0580c5f5a
commit 42f977f536
2 changed files with 10 additions and 13 deletions

View File

@@ -85,4 +85,14 @@ auto_derived!(
/// User object
pub user: User,
}
/// Bot Details
pub struct DataCreateBot {
/// Bot username
#[cfg_attr(
feature = "validator",
validate(length(min = 2, max = 32), regex = "RE_USERNAME")
)]
name: String,
}
);

View File

@@ -1,25 +1,12 @@
use crate::util::regex::RE_USERNAME;
use nanoid::nanoid;
use revolt_quark::{
models::{user::BotInformation, Bot, User},
variables::delta::MAX_BOT_COUNT,
Db, Error, Result,
};
use rocket::serde::json::Json;
use serde::Deserialize;
use ulid::Ulid;
use validator::Validate;
/// # Bot Details
#[derive(Validate, Deserialize, JsonSchema)]
pub struct DataCreateBot {
/// Bot username
#[validate(length(min = 2, max = 32), regex = "RE_USERNAME")]
name: String,
}
/// # Create Bot
///
/// Create a new Revolt bot.