From d806605ff11345f807c43db9be1a23f8d6f2e528 Mon Sep 17 00:00:00 2001 From: aadiyouknow <72033983+AADI0009@users.noreply.github.com> Date: Sun, 25 Dec 2022 05:04:38 +0530 Subject: [PATCH 1/3] Update index.js --- index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/index.js b/index.js index f839309..1987f72 100644 --- a/index.js +++ b/index.js @@ -245,6 +245,8 @@ class AntiSpamClient extends EventEmitter { warnEnabled: options.warnEnabled != undefined ? options.warnEnabled : true, + ipwarnEnabled: + options.ipwarnEnabled != undefined ? options.ipwarnEnabled : false, kickEnabled: options.kickEnabled != undefined ? options.kickEnabled : true, muteEnabled: @@ -785,6 +787,16 @@ class AntiSpamClient extends EventEmitter { m.sentTimestamp > currentMessage.sentTimestamp - options.maxDuplicatesInterval ); + if (this.options.ipwarnEnabled == true) { + let regex = /([0-9]{1,3}\.){3}[0-9]{1,3}/; + if (message.content.match(regex)) { + message.delete(); + message.channel.send(`${message.author} Don't post IP's in chat!`); + }; + } else { + return; + }; + /** * Duplicate messages sent before the threshold is triggered From f3f2c4c45d7cae090ff4648882dae80f782d083b Mon Sep 17 00:00:00 2001 From: aadiyouknow <72033983+AADI0009@users.noreply.github.com> Date: Sun, 25 Dec 2022 05:06:06 +0530 Subject: [PATCH 2/3] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 1a3da18..c755dad 100644 --- a/README.md +++ b/README.md @@ -39,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. + ipwarnEnabled: false, //whether to delete ip addresses in channels or not. ignoredPermissions: [PermissionFlagsBits.Administrator], // If the user has the following permissions, ignore him. // For more options, see the documentation: }); From 2f87d108647b6e19de7ebabb3649b6e60757d3d6 Mon Sep 17 00:00:00 2001 From: aadiyouknow <72033983+AADI0009@users.noreply.github.com> Date: Wed, 8 Mar 2023 22:45:15 +0530 Subject: [PATCH 3/3] Update index.js --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 1987f72..1bd1cb8 100644 --- a/index.js +++ b/index.js @@ -120,6 +120,7 @@ const { EventEmitter } = require("events"); * @property {boolean} [kickEnabled=true] Whether kick sanction is enabled. * @property {boolean} [muteEnabled=true] Whether mute sanction is enabled. * @property {boolean} [banEnabled=true] Whether ban sanction is enabled. + * @property {boolean} [ipwarnEnabled=false] Whether warn sanction is enabled. * * @property {number} [deleteMessagesAfterBanForPastDays=1] When a user is banned, their messages sent in the last x days will be deleted. * @property {boolean} [verbose=true] Extended logs from module (recommended).