Michael-J-Scofield / discord-anti-spam

A simple discord anti spam node.js module to prevent spam on your discord server
MIT License
146 stars 53 forks source link

Default values in AntiSpamClientOptions constructor broken #125

Closed chlohe closed 3 years ago

chlohe commented 3 years ago

Describe the bug Setting muteEnabled = false in AntiSpamClientOptions doesn't work.

To Reproduce Steps to reproduce the behavior:

  1. const antiSpam = new AntiSpam({ muteEnabled: false });
  2. console.log(antiSpam);
  3. The muteEnabled field says true.

Expected behavior The muteEnabled field says false.

Cause See index.js: warnEnabled: options.warnEnabled || true is always going to evaluate to true by definition of ||.

This bug also affects a couple of other options.