diff --git a/src/modules/misc.js b/src/modules/misc.js index f4b08d3..58b57a8 100644 --- a/src/modules/misc.js +++ b/src/modules/misc.js @@ -650,7 +650,23 @@ color.callback = async function (msg, line, args, {truerandom, first}) { 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 random = hexes[Math.floor(Math.random() * hexes.length)]; + + const left = "- #" + hexes.slice(0, Math.ceil(hexes.length / 2)).join("\n- #"); + const right = "- #" + hexes.slice(Math.ceil(hexes.length / 2), hexes.length).join("\n- #"); + + return { + embed: { + color: parseInt(`0x${random}`), + footer: { + text: `Picked #${random} for embed color \u2022 Use \`--first\` or the \`first\` option to bypass this`, + }, + fields: [ + {name: `Got ${colornamesMatches.length} matches for`, value: left, inline: true}, + {name: `\`${safeString(line)}\``, value: right, inline: true}, + ], + }, + }; } }