guildinfo: make clan info stylized to how it looks in client
This commit is contained in:
		
							parent
							
								
									acd29ae5f5
								
							
						
					
					
						commit
						ce849c6a37
					
				
					 2 changed files with 20 additions and 16 deletions
				
			
		| 
						 | 
				
			
			@ -84,7 +84,15 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
 | 
			
		|||
              game = await hf.bot.requestHandler.request("GET", APIEndpoints.APPLICATION_RPC(id), false);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return `${game.name} (\`${id}\`)`;
 | 
			
		||||
            let out = `${game.name} (\`${id}\`)`;
 | 
			
		||||
 | 
			
		||||
            if (clan.game_activity[id]?.level > 1) {
 | 
			
		||||
              out = `:fire: ${out}`;
 | 
			
		||||
            } else {
 | 
			
		||||
              out = `${Icons.blank} ${out}`;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return out;
 | 
			
		||||
          })
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -105,8 +113,14 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
 | 
			
		|||
        }
 | 
			
		||||
 | 
			
		||||
        clanEmbed = {
 | 
			
		||||
          title: _guild != null ? "Clan data" : clan.name,
 | 
			
		||||
          description: clan.description ?? "*No description*",
 | 
			
		||||
          color: parseInt(clan.brand_color_primary.replace("#", "0x")),
 | 
			
		||||
          title: _guild == null ? clan.name : null,
 | 
			
		||||
          author: {
 | 
			
		||||
            name: clan.tag,
 | 
			
		||||
          },
 | 
			
		||||
          description: `-# :video_game:${ClanPlaystyle[clan.playstyle] ?? "Unknown"}${
 | 
			
		||||
            clan.wildcard_descriptors.length > 0 ? ` \u2022 **${clan.wildcard_descriptors.join(", ")}**` : ""
 | 
			
		||||
          }\n\n${clan.description ?? "*No description*"}`,
 | 
			
		||||
          fields: [
 | 
			
		||||
            !_guild && {
 | 
			
		||||
              name: "Member Count",
 | 
			
		||||
| 
						 | 
				
			
			@ -118,16 +132,6 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
 | 
			
		|||
              value: clan.tag,
 | 
			
		||||
              inline: true,
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
              name: "Playstyle",
 | 
			
		||||
              value: ClanPlaystyle[clan.playstyle] ?? `<unknown value: ${clan.playstyle}>`,
 | 
			
		||||
              inline: true,
 | 
			
		||||
            },
 | 
			
		||||
            clan.wildcard_descriptors.length > 0 && {
 | 
			
		||||
              name: "Descriptors",
 | 
			
		||||
              value: `**${clan.wildcard_descriptors.join(", ")}**`,
 | 
			
		||||
              inline: true,
 | 
			
		||||
            },
 | 
			
		||||
            clan.search_terms.length > 0 && {
 | 
			
		||||
              name: "Interests/Topics/Traits",
 | 
			
		||||
              value: termLines.join("\n"),
 | 
			
		||||
| 
						 | 
				
			
			@ -135,7 +139,7 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
 | 
			
		|||
            },
 | 
			
		||||
            games.length > 0 && {
 | 
			
		||||
              name: "Associated Games",
 | 
			
		||||
              value: `- ${games.join("\n- ")}`,
 | 
			
		||||
              value: `${games.join("\n")}`,
 | 
			
		||||
              inline: false,
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
| 
						 | 
				
			
			@ -155,7 +159,7 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
 | 
			
		|||
        if (clan.badge_hash) {
 | 
			
		||||
          const url = CDNEndpoints.CLAN_BADGE(clan.id, clan.badge_hash);
 | 
			
		||||
          images.push(`[Badge](${url})`);
 | 
			
		||||
          clanEmbed.thumbnail = {url};
 | 
			
		||||
          clanEmbed.author.icon_url = url;
 | 
			
		||||
        }
 | 
			
		||||
        if (clan.banner_hash) {
 | 
			
		||||
          const url = CDNEndpoints.CLAN_BANNER(clan.id, clan.banner_hash);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -391,7 +391,7 @@ userinfo.callback = async function (msg, line) {
 | 
			
		|||
      clanData && {
 | 
			
		||||
        name: "Clan",
 | 
			
		||||
        value: `${clanData.name} (\`${user.clan.identity_guild_id}\`)\n-# :video_game:${
 | 
			
		||||
          ClanPlaystyle[clanData.playstyle]
 | 
			
		||||
          ClanPlaystyle[clanData.playstyle] ?? "Unknown"
 | 
			
		||||
        }${clanData.wildcard_descriptors.length > 0 ? ` \u2022 **${clanData.wildcard_descriptors.join(", ")}**` : ""}`,
 | 
			
		||||
        inline: true,
 | 
			
		||||
      },
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue