Team-Gigabyte / quotobot

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