From 5248ef1f7583af0ba5976b8f81c204a79ed3663b Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Wed, 31 Jul 2024 21:49:57 -0600 Subject: [PATCH] misc.color: link to colornames page for the color instead of homepage --- src/modules/misc.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/modules/misc.js b/src/modules/misc.js index 68f670c..3c55508 100644 --- a/src/modules/misc.js +++ b/src/modules/misc.js @@ -663,7 +663,8 @@ color.callback = async function (msg, line, args, {truerandom}) { }) .png() .toBuffer(); - const fileName = `${color.toHex()}.png`; + const hex = color.toHex(); + const fileName = `${hex}.png`; const fields = [ { @@ -701,9 +702,12 @@ color.callback = async function (msg, line, args, {truerandom}) { }); } - const colornamesName = colornamesRaw.match(new RegExp(`^${color.toHex()},([^,]+?),`, "im"))?.[1]; + const colornamesName = colornamesRaw.match(new RegExp(`^${hex},([^,]+?),`, "im"))?.[1]; if (colornamesName) { - fields.push({name: "\u200b", value: `**[colornames](https://colornames.org/) Name**\n${colornamesName}`}); + fields.push({ + name: "\u200b", + value: `**[colornames](https://colornames.org/color/${hex}) Name**\n${colornamesName}`, + }); } return {