#how do i cancel my censored messages?
1 messages · Page 1 of 1 (latest)
Debug Result
There are 2 errors in this [code](#1210723567180976238 message):
[36m<repl>.js[0m:[33m9[0m:[33m26[0m - [31merror[0m[30m TS18048: [0m'data.formValues' is possibly 'undefined'.
[7m9[0m const cens = data.formValues[0];
[7m [0m [31m ~~~~~~~~~~~~~~~[0m
``````ansi
[36m<repl>.js[0m:[33m10[0m:[33m33[0m - [31merror[0m[30m TS2339: [0mProperty 'toLowerCase' does not exist on type 'string | number | boolean'.
Property 'toLowerCase' does not exist on type 'number'.
[7m10[0m censoredw.push(cens.toLowerCase());
[7m [0m [31m ~~~~~~~~~~~[0m
hmm
app did work for me
do a map instead of some
that may work
also mc dont need any more censored words
and u should also add a replace feature
did map work?
Why not try with if(censoredwr.includes(msg.toLowerCase))
I mean, detect if the list of censured words includes the msg
const allWords = msg.split(" ");
Mmmmm now I get it
const allWords = msg.split(" ");
allWords.forEach((w) => {
if (censoredwr.includes(w)) {
// Do stuff
}
}
@agile wharf
Yeah, some like that
that should work im like 99% sure its undefined when ur checking the if statement