From 5dd0d071f0534bb8b81ed2e9ea578a6cf4e6339a Mon Sep 17 00:00:00 2001 From: Michal Date: Tue, 26 Jul 2022 10:58:21 +0200 Subject: [PATCH] Update docs and ignorepermissions method --- README.md | 6 ++---- docs/global.html | 2 +- docs/index.html | 6 ++---- index.js | 2 +- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index c9dd874..1a3da18 100644 --- a/README.md +++ b/README.md @@ -23,10 +23,7 @@ Example of a basic bot handling spam messages using this module. ```js const { Client, GatewayIntentBits, Partial } = require("discord.js"); const client = new Client({ - intents: [ - GatewayIntentBits.FLAGS.GUILDS, - GatewayIntentBits.FLAGS.GUILD_MESSAGES, - ], + intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages], partials: [Partials.Channel], }); const AntiSpam = require("discord-anti-spam"); @@ -42,6 +39,7 @@ const antiSpam = new AntiSpam({ unMuteTime: 60, // Time in minutes before the user will be able to send messages again. verbose: true, // Whether or not to log every action in the console. removeMessages: true, // Whether or not to remove all messages sent by the user. + ignoredPermissions: [PermissionFlagsBits.Administrator], // If the user has the following permissions, ignore him. // For more options, see the documentation: }); diff --git a/docs/global.html b/docs/global.html index b8d9c37..4f71f51 100644 --- a/docs/global.html +++ b/docs/global.html @@ -2106,7 +2106,7 @@
Properties:
-

Users with at least one of these permissions will be ignored.

+

Users with at least one of these permissions will be ignored. Please use the PermissionFlagsBits function. (https://discord.js.org/#/docs/discord.js/main/class/PermissionsBitField?scrollTo=s-Flags)

diff --git a/docs/index.html b/docs/index.html index 34ccfc3..cead81c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -61,10 +61,7 @@

Example

Example of a basic bot handling spam messages using this module.

const { Client, GatewayIntentBits, Partial } = require("discord.js");
 const client = new Client({
-  intents: [
-    GatewayIntentBits.FLAGS.GUILDS,
-    GatewayIntentBits.FLAGS.GUILD_MESSAGES,
-  ],
+  intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages],
   partials: [Partials.Channel],
 });
 const AntiSpam = require("discord-anti-spam");
@@ -80,6 +77,7 @@ 

Example

unMuteTime: 60, // Time in minutes before the user will be able to send messages again. verbose: true, // Whether or not to log every action in the console. removeMessages: true, // Whether or not to remove all messages sent by the user. + ignoredPermissions: [PermissionFlagsBits.Administrator], // If the user has the following permissions, ignore him. // For more options, see the documentation: }); diff --git a/index.js b/index.js index 7c86e1f..aa0fd92 100644 --- a/index.js +++ b/index.js @@ -105,7 +105,7 @@ const { EventEmitter } = require("events"); * @property {Discord.Snowflake|string[]|IgnoreRoleFunction} [ignoredRoles=[]] Array of role IDs or role names that are ignored. Members with one of these roles will be ignored. * @property {Discord.Snowflake|string[]|IgnoreGuildFunction} [ignoredGuilds=[]] Array of guild IDs or guild names that are ignored. * @property {Discord.Snowflake|string[]|IgnoreChannelFunction} [ignoredChannels=[]] Array of channel IDs or channel names that are ignored. - * @property {Discord.PermissionString[]} [ignoredPermissions=[]] Users with at least one of these permissions will be ignored. + * @property {Discord.PermissionString[]} [ignoredPermissions=[]] Users with at least one of these permissions will be ignored. Please use the PermissionFlagsBits function. (https://discord.js.org/#/docs/discord.js/main/class/PermissionsBitField?scrollTo=s-Flags) * @property {boolean} [ignoreBots=true] Whether bots should be ignored. * * @property {boolean} [warnEnabled=true] Whether warn sanction is enabled.