diff --git a/src/modules/utility/userinfo.js b/src/modules/utility/userinfo.js index bed3e11..6fbba8f 100644 --- a/src/modules/utility/userinfo.js +++ b/src/modules/utility/userinfo.js @@ -16,7 +16,7 @@ const { Icons, } = require("@util/constants.js"); -const {formatUsername, getDefaultAvatar} = require("@util/misc.js"); +const {formatUsername, getDefaultAvatar, getTopColor, pastelize} = require("@util/misc.js"); const {snowflakeToTimestamp} = require("@util/time.js"); const ONE_MONTH = 2628000; @@ -289,7 +289,7 @@ userinfo.callback = async function (msg, line) { } const embed = { - color: user.accent_color, + color: getTopColor(msg, id, user.accent_color ?? pastelize(id)), thumbnail: { url: avatar, }, @@ -361,6 +361,14 @@ userinfo.callback = async function (msg, line) { }, }; + if (embed.fields.length == 2) { + // assumed created + images + embed.fields[1].inline = false; + } else if (embed.fields.length == 3) { + // assumed created + clan + images + embed.fields[2].inline = false; + } + return {embeds: [embed]}; }; hf.registerCommand(userinfo);