misc.color: attempt fix
This commit is contained in:
parent
f971240c03
commit
295369bbc9
1 changed files with 37 additions and 32 deletions
|
@ -628,20 +628,7 @@ color.callback = async function (msg, line, args, {truerandom}) {
|
|||
.toBuffer();
|
||||
const fileName = `${color.toHex()}.png`;
|
||||
|
||||
return {
|
||||
embeds: [
|
||||
{
|
||||
title: random ? "Random Color" : "",
|
||||
color: color.toNumber(),
|
||||
thumbnail: {
|
||||
url: `attachment://${fileName}`,
|
||||
},
|
||||
fields: [
|
||||
color.toName() && {
|
||||
name: "Name",
|
||||
value: color.toName(),
|
||||
inline: true,
|
||||
},
|
||||
const fields = [
|
||||
{
|
||||
name: "Hex",
|
||||
value: color.toHexString(),
|
||||
|
@ -667,7 +654,25 @@ color.callback = async function (msg, line, args, {truerandom}) {
|
|||
value: color.toNumber(),
|
||||
inline: true,
|
||||
},
|
||||
].filter((f) => f != null),
|
||||
];
|
||||
|
||||
if (color.toName() != false) {
|
||||
fields.splice(0, 0, {
|
||||
name: "Name",
|
||||
value: color.toName(),
|
||||
inline: true,
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
embeds: [
|
||||
{
|
||||
title: random ? "Random Color" : "",
|
||||
color: color.toNumber(),
|
||||
thumbnail: {
|
||||
url: `attachment://${fileName}`,
|
||||
},
|
||||
fields,
|
||||
},
|
||||
],
|
||||
file: {
|
||||
|
|
Loading…
Reference in a new issue