From c5b50cf73bd5a3f4a34faa7f34d823e7f30a8ba3 Mon Sep 17 00:00:00 2001 From: Essem Date: Sat, 1 Oct 2022 12:03:37 -0500 Subject: [PATCH] Make uncanny skip hidden/non-PNG files --- commands/image-editing/uncanny.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commands/image-editing/uncanny.js b/commands/image-editing/uncanny.js index 1c20263..49b2fe3 100644 --- a/commands/image-editing/uncanny.js +++ b/commands/image-editing/uncanny.js @@ -4,7 +4,9 @@ import { readdirSync } from "fs"; import { resolve, dirname } from "path"; import { fileURLToPath } from "url"; const prompts = ["you found:", "your dad is:", "you ate:", "your mom is:", "your sister is:", "you saw:", "you get lost in:", "you find:", "you grab:", "you pull out of your pocket:", "you fight:", "it's in your room:"]; -const names = readdirSync(resolve(dirname(fileURLToPath(import.meta.url)), "../../assets/images/uncanny/")).map((val) => { +const names = readdirSync(resolve(dirname(fileURLToPath(import.meta.url)), "../../assets/images/uncanny/")).filter((val) => { + if (!val.startsWith(".") && val.endsWith(".png")) return true; +}).map((val) => { return val.split(".")[0]; });