diff --git a/src/modules/misc.js b/src/modules/misc.js index 3c55508..e55554f 100644 --- a/src/modules/misc.js +++ b/src/modules/misc.js @@ -645,7 +645,14 @@ color.callback = async function (msg, line, args, {truerandom}) { } if (!color.isValid) { - const colornamesHex = colornamesRaw.match(new RegExp(`^([0-9a-f]{6}),${line},`, "im"))?.[1]; + const search = `^([0-9a-f]{6}),${line},`; + const colornamesMatches = colornamesRaw.match(new RegExp(search, "img")); + if (colornamesMatches.length > 1) { + const hexes = colornamesMatches.map((m) => m.split(",")[0]); + return `Got ${colornamesMatches.length} matches for \`${safeString(line)}\`\n- ${hexes.join("\n- ")}`; + } + + const colornamesHex = colornamesRaw.match(new RegExp(search, "im"))?.[1]; if (colornamesHex) { color = tinycolor(colornamesHex); } else {