misc.color: link to colornames page for the color instead of homepage
This commit is contained in:
parent
3d06d43131
commit
5248ef1f75
1 changed files with 7 additions and 3 deletions
|
@ -663,7 +663,8 @@ color.callback = async function (msg, line, args, {truerandom}) {
|
||||||
})
|
})
|
||||||
.png()
|
.png()
|
||||||
.toBuffer();
|
.toBuffer();
|
||||||
const fileName = `${color.toHex()}.png`;
|
const hex = color.toHex();
|
||||||
|
const fileName = `${hex}.png`;
|
||||||
|
|
||||||
const fields = [
|
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) {
|
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 {
|
return {
|
||||||
|
|
Loading…
Reference in a new issue