From 16ef1316144640984072be20ceffbb2aac0b6514 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Thu, 29 Oct 2020 12:45:18 -0400 Subject: [PATCH] Fix --- commands/edit-image/ace-attorney.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/commands/edit-image/ace-attorney.js b/commands/edit-image/ace-attorney.js index 33dbe290..2c53a3b9 100644 --- a/commands/edit-image/ace-attorney.js +++ b/commands/edit-image/ace-attorney.js @@ -66,8 +66,14 @@ module.exports = class AceAttorneyCommand extends Command { } async run(msg, { character, quote }) { + let file; + for (const [id, arr] of Object.entries(characters)) { + if (!arr.includes(character.toLowerCase())) continue; + file = id; + break; + } const base = await loadImage( - path.join(__dirname, '..', '..', 'assets', 'images', 'ace-attorney', `${character}.png`) + path.join(__dirname, '..', '..', 'assets', 'images', 'ace-attorney', `${file}.png`) ); const canvas = createCanvas(base.width, base.height); const ctx = canvas.getContext('2d');