userinfo: add decoration field
This commit is contained in:
		
							parent
							
								
									7d413d38ff
								
							
						
					
					
						commit
						8dd9cde7d7
					
				
					 1 changed files with 17 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -229,6 +229,14 @@ userinfo.callback = async function (msg, line) {
 | 
			
		|||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  let decoration, decorationUrl;
 | 
			
		||||
  if (user.avatar_decoration_data) {
 | 
			
		||||
    decoration = await hf.bot.requestHandler
 | 
			
		||||
      .request("GET", APIEndpoints.STORE_PUBLISHED_LISTING(user.avatar_decoration_data.sku_id), true)
 | 
			
		||||
      .catch(() => {});
 | 
			
		||||
    decorationUrl = CDNEndpoints.AVATAR_DECORATION(user.avatar_decoration_data.asset);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  const shared = Array.from(hf.bot.guilds.values()).filter((g) => g.members.get(id) != null);
 | 
			
		||||
 | 
			
		||||
  const descLines = [];
 | 
			
		||||
| 
						 | 
				
			
			@ -300,6 +308,15 @@ userinfo.callback = async function (msg, line) {
 | 
			
		|||
        value: member.nick,
 | 
			
		||||
        inline: true,
 | 
			
		||||
      },
 | 
			
		||||
      user.avatar_decoration_data && {
 | 
			
		||||
        name: `Avatar Decoration ${user.avatar_decoration_data.asset.startsWith("a_") ? "(Animated)" : ""}`,
 | 
			
		||||
        value: `${
 | 
			
		||||
          decoration?.sku
 | 
			
		||||
            ? `[${decoration?.sku?.name}](https://discord.com/shop#itemSkuId=${user.avatar_decoration_data.sku_id})`
 | 
			
		||||
            : "Unknown"
 | 
			
		||||
        } (\`${user.avatar_decoration_data.sku_id}\`)\n[Image](${decorationUrl})`,
 | 
			
		||||
        inline: true,
 | 
			
		||||
      },
 | 
			
		||||
      member?.roles?.length > 0 && {
 | 
			
		||||
        name: "Roles",
 | 
			
		||||
        value: member.roles
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue