Skip to content

Commit

Permalink
negate ensure
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacherr committed Sep 13, 2024
1 parent e0f55ca commit a4f0216
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion assyst-core/src/command/misc/tag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ pub async fn create(ctxt: CommandCtxt<'_>, name: Word, contents: RestNoFlags) ->
let Some(guild_id) = ctxt.data.guild_id else {
bail!("Tags can only be created in guilds.")
};

ensure!(name.0.len() < 20, "Tag names cannot exceed 20 characters.");
ensure!(
!RESERVED_NAMES.contains(&&name.0[..]),
"Tag names cannot be a reserved word."
);
ensure!(name.0.contains(" "), "Tag names cannot contain spaces.");
ensure!(!name.0.contains(" "), "Tag names cannot contain spaces.");

let tag = Tag {
name: name.0.to_ascii_lowercase(),
Expand Down

0 comments on commit a4f0216

Please sign in to comment.