Skip to content

Commit dc4d000

Browse files
committed
feat: move normalization above quiz msg val
1 parent 71e86c8 commit dc4d000

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/components/events/message.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ export default async function (msg: Message, type: string) {
4747
)
4848
return; // ignore them all
4949

50+
// process normalization
51+
msg.body = msg.body
52+
.normalize("NFKC")
53+
.replace(/[\u0300-\u036f\u00b4\u0060\u005e\u007e]/g, "")
54+
.trim();
55+
5056
/*
5157
*
5258
* Quiz command validation
@@ -56,12 +62,6 @@ export default async function (msg: Message, type: string) {
5662
if (await quiz(msg, quoted)) return;
5763
}
5864

59-
// process normalization
60-
msg.body = msg.body
61-
.normalize("NFKC")
62-
.replace(/[\u0300-\u036f\u00b4\u0060\u005e\u007e]/g, "")
63-
.trim();
64-
6565
const prefix = !msg.body.startsWith(commandPrefix);
6666
const lid = msg.author ? msg.author.split("@")[0] : msg.from.split("@")[0];
6767

0 commit comments

Comments
 (0)