xxxxxxxxxx
if (Type == 2 && (PageCount == 0 || PageCount == '')) {
xxxxxxxxxx
const str = "hi, there"
const res = str.includes("hello") || str.includes("hi") || str.includes('howdy');
console.log(res); // true
use some() instead of includes()
xxxxxxxxxx
// test cases
const str1 = 'hi hello, how do you do?';
const str2 = 'regular string';
const str3 = 'hello there';
// do the test strings contain these terms?
const conditions = ["hello", "hi", "howdy"];
// run the tests against every element in the array
const test1 = conditions.some(el => str1.includes(el));
const test2 = conditions.some(el => str2.includes(el));
// strictly check that contains 1 and only one match
const test3 = conditions.reduce((a,c) => a + str3.includes(c), 0) == 1;
// display results
console.log(`Loose matching, 2 matches "${str1}" => ${test1}`);
console.log(`Loose matching, 0 matches "${str2}" => ${test2}`);
console.log(`Exact matching, 1 matches "${str3}" => ${test3}`);
Run code snippet
xxxxxxxxxx
if (message.content.startswith('server') || message.sender === 'ID') {return}
xxxxxxxxxx
if (message.content.startswith('server') || message.sender === 'ID') {return}