Skip to content

Commit

Permalink
feat: start work on migrating routes
Browse files Browse the repository at this point in the history
  • Loading branch information
insertish committed Aug 3, 2023
1 parent a0580c5 commit 42f977f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
10 changes: 10 additions & 0 deletions crates/core/models/src/v0/bots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
);
13 changes: 0 additions & 13 deletions crates/delta/src/routes/bots/create.rs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit 42f977f

Please sign in to comment.