From ed7c6eeec545482ef7e34478aa3f2cf16be661e6 Mon Sep 17 00:00:00 2001 From: Elijah R Date: Sun, 23 Jun 2024 19:59:29 -0400 Subject: [PATCH] cleaner way to check the blacklist --- src/index.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/index.ts b/src/index.ts index a7b2b6f..c0aef2f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -379,11 +379,9 @@ class HelperBot extends CollabVMClient { let arg = message.slice(message.indexOf(" ") + 1); let ext = arg.slice(arg.lastIndexOf(".") + 1); if (arg.indexOf("..") !== -1) return; - for (var ii = 0; ii < config.BANNED_ISO.length; ii++) { - if (config.BANNED_ISO[ii].test(arg)) { - this.Chat("That ISO is currently blacklisted."); - return; - } + if (config.BANNED_ISO.some((b) => b.test(arg))) { + this.Chat("That ISO is currently blacklisted."); + return; } switch (command) {