Skip to content

Commit

Permalink
Merge pull request #98 from Antouto/main
Browse files Browse the repository at this point in the history
Add including cylde to forbidden usernames
  • Loading branch information
maddy authored Jul 9, 2023
2 parents d5f3ded + 543ed6d commit 6ce6d34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/form/validators/isUsername.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const isUsername = () => {
return (value: string): string | false => {
for (const forbidden of ["discord", "```", "system message"]) {
for (const forbidden of ["discord", "clyde", "```", "system message"]) {
if (value.toLowerCase().includes(forbidden)) {
return `Username cannot contain "${forbidden}"`
}
Expand Down
4 changes: 2 additions & 2 deletions modules/editor/data/validation/isUsername.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { isString } from "./isString"
import type { Validator } from "./Validator"

export const isUsername: Validator = first(isString, (value, key) =>
!/(^(everyone|here)$)|discord|```|system message/i.test(value as string)
!/(^(everyone|here)$)|discord|clyde|```|system message/i.test(value as string)
? []
: [
`${key}: Cannot contain "discord", "system message", or "\`\`\`", and cannot be "here" or "everyone"`,
`${key}: Cannot contain "discord", "clyde", "system message", or "\`\`\`", and cannot be "here" or "everyone"`,
],
)

0 comments on commit 6ce6d34

Please sign in to comment.