@@ -45,7 +45,7 @@ the original license and copyright notice is licence agreement breach and its co
4545
4646////////////////////////////////////////////////////
4747//------------------------------------------------//
48- // Scripp checks, imports & functions //
48+ // Script checks, imports //
4949//------------------------------------------------//
5050////////////////////////////////////////////////////
5151
@@ -122,6 +122,7 @@ if(method.ModeratingLinks()) {
122122 // it's not an url
123123 // do nothing
124124 }
125+ // Check if channel is allowed channel
125126 } else if ( message . channel . id === config . Allowed_Channel_2 ) {
126127 // check if the message in allowed channel has url
127128 if ( method . containsUrl ( message . content ) ) {
@@ -140,6 +141,7 @@ if(method.ModeratingLinks()) {
140141 // it's not an url
141142 // do nothing
142143 }
144+ // Check if channel is allowed channel
143145 } else if ( message . channel . id === config . Allowed_Channel_3 ) {
144146 // check if the message in allowed channel has url
145147 if ( method . containsUrl ( message . content ) ) {
@@ -158,6 +160,7 @@ if(method.ModeratingLinks()) {
158160 // it's not an url
159161 // do nothing
160162 }
163+ // Check if channel is allowed channel
161164 } else if ( message . channel . id === config . Allowed_Channel_4 ) {
162165 // check if the message in allowed channel has url
163166 if ( method . containsUrl ( message . content ) ) {
@@ -176,6 +179,7 @@ if(method.ModeratingLinks()) {
176179 // it's not an url
177180 // do nothing
178181 }
182+ // Check if channel is allowed channel
179183 } else if ( message . channel . id === config . Allowed_Channel_5 ) {
180184 // check if the message in allowed channel has url
181185 if ( method . containsUrl ( message . content ) ) {
@@ -194,6 +198,7 @@ if(method.ModeratingLinks()) {
194198 // it's not an url
195199 // do nothing
196200 }
201+ // Check if channel is allowed channel
197202 } else if ( message . channel . id === config . Allowed_Channel_6 ) {
198203 // check if the message in allowed channel has url
199204 if ( method . containsUrl ( message . content ) ) {
@@ -216,8 +221,11 @@ if(method.ModeratingLinks()) {
216221
217222 else {
218223 }
224+ // Check if message is not in allowed channels
219225if ( ! ( ( message . channel . id == config . Allowed_Channel_1 ) || ( message . channel . id == config . Allowed_Channel_2 ) || ( message . channel . id == config . Allowed_Channel_3 ) || ( message . channel . id == config . Allowed_Channel_4 ) || ( message . channel . id == config . Allowed_Channel_5 ) || ( message . channel . id == config . Allowed_Channel_6 ) ) ) {
226+ // Check if message contains url
220227 if ( method . containsUrl ( message . content ) ) {
228+ // Check configuration
221229 if ( method . MessageAfterDeleteLink ( ) ) {
222230 message . author . send ( config . GlobalDeleteURL )
223231 }
@@ -236,20 +244,22 @@ if (!((message.channel.id == config.Allowed_Channel_1) || (message.channel.id ==
236244//------------------------------------------------//
237245////////////////////////////////////////////////////
238246
239-
247+ // If this feature is enabled (checks config)
240248if ( method . DeletingCommands ( ) ) {
249+ // On message event
241250 refloow . on ( "message" , ( message ) => {
242251
252+ // Importing Blacklisted prefixes from config
243253 let blacklisted = config . blacklisted ;
244254
245- // PREFIX ACTIONS
246-
247255 for ( var i in blacklisted ) {
256+ // If message is command (contains prefix)
248257 if ( message . content . startsWith ( blacklisted [ i ] ) ) {
249- if ( method . DeletingCommands ( ) ) {
258+ // Delete it
250259 message . delete ( )
251- }
260+ // Check configuration
252261 if ( method . MessageAfterDelete ( ) ) {
262+ // Message user if enabled
253263 message . author . send ( config . MessageAfterDelete ) ;
254264 }
255265 }
@@ -263,18 +273,22 @@ if(method.DeletingCommands()) {
263273//------------------------------------------------//
264274////////////////////////////////////////////////////
265275
266-
276+ // Is this feature enabled (checks config)
267277if ( method . ChatFilterEnabled ( ) ) {
278+ // On message event
268279 refloow . on ( "message" , ( message ) => {
269280
281+ // Importing words from config
270282 let bannedwords = config . bannedwords ;
271283
272- // PREFIX ACTIONS
273-
274284 for ( var i in bannedwords ) {
285+ // If message contains bad words
275286 if ( message . content . toLowerCase ( ) . includes ( bannedwords [ i ] ) ) {
287+ // Delete it
276288 message . delete ( )
289+ // Checks config
277290 if ( method . MessageAfterDeleteFilter ( ) ) {
291+ // Messageu user if enabled
278292 message . author . send ( config . MessageAfterDelete_filter ) ;
279293 }
280294 }
0 commit comments