feat: restrict role colours to regex (increase length limit)

This commit is contained in:
Paul Makles
2022-07-15 15:36:00 +01:00
parent d96c9f62c4
commit f1171e5358
6 changed files with 30 additions and 5 deletions

View File

@@ -1,3 +1,5 @@
use crate::util::regex::RE_COLOUR;
use serde::{Deserialize, Serialize};
use validator::Validate;
@@ -33,7 +35,7 @@ pub struct SendableEmbed {
#[validate(length(min = 1, max = 2000))]
pub description: Option<String>,
pub media: Option<String>,
#[validate(length(min = 1, max = 64))]
#[validate(length(min = 1, max = 128), regex = "RE_COLOUR")]
pub colour: Option<String>,
}