Team-Gigabyte / quotobot

Function with cyclomatic complexity higher than threshold JS-R1005
Anti-pattern
Minor
6 days ago5 months old
Function has a cyclomatic complexity of 52 with "critical" risk
216bot.login(token);
217bot.on("warn", m => console.warn(chalk`{yellow Warning: ${m}}`));
218bot.on("error", m => console.error(chalk`{redBright Error: ${m}}`));
219bot.on("message", message => {220    if (message.author.id == envVars?.QBBAN) return;
221    const prefixRegex = new RegExp(`^(<@!?${bot.user.id}>|${escapeRegExp(prefix)})\\s*`);
222    if ((!prefixRegex.test(message.content)) || message.author.bot) return;