Allow empty content through block list
This commit is contained in:
parent
b504edae92
commit
de15b3a9a4
@ -74,7 +74,7 @@ export class Member extends BaseClassWithoutId {
|
|||||||
nick?: string;
|
nick?: string;
|
||||||
|
|
||||||
setNick(val: string) {
|
setNick(val: string) {
|
||||||
if (BannedWords.find(val)) throw FieldErrors({ nick: { message: "Bad nickname", code: "INVALID_NICKNAME" } });
|
if (val && BannedWords.find(val)) throw FieldErrors({ nick: { message: "Bad nickname", code: "INVALID_NICKNAME" } });
|
||||||
this.nick = val;
|
this.nick = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ export class Message extends BaseClass {
|
|||||||
content?: string;
|
content?: string;
|
||||||
|
|
||||||
setContent(val: string) {
|
setContent(val: string) {
|
||||||
if (BannedWords.find(val)) throw new HTTPError("Message was blocked by automatic moderation", 200000);
|
if (val && BannedWords.find(val)) throw new HTTPError("Message was blocked by automatic moderation", 200000);
|
||||||
this.content = val;
|
this.content = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user