mirror of
				https://github.com/keanuplayz/TravBot-v3.git
				synced 2024-08-15 02:33:12 +00:00 
			
		
		
		
	Fixed info guild short-circuiting
This commit is contained in:
		
							parent
							
								
									c4b077757f
								
							
						
					
					
						commit
						576e55fbdf
					
				
					 1 changed files with 44 additions and 44 deletions
				
			
		|  | @ -196,9 +196,8 @@ async function getGuildInfo(guild: Guild, currentGuild: Guild | null) { | |||
|     const iconURL = guild.iconURL({dynamic: true}); | ||||
|     const embed = new MessageEmbed().setDescription(`**Guild information for __${guild.name}__**`).setColor("BLUE"); | ||||
|     const displayRoles = !!(currentGuild && guild.id === currentGuild.id); | ||||
|     if (iconURL) { | ||||
| 
 | ||||
|     embed | ||||
|             .setThumbnail(iconURL) | ||||
|         .addField("General", [ | ||||
|             `**❯ Name:** ${guild.name}`, | ||||
|             `**❯ ID:** ${guild.id}`, | ||||
|  | @ -207,9 +206,9 @@ async function getGuildInfo(guild: Guild, currentGuild: Guild | null) { | |||
|             `**❯ Boost Tier:** ${guild.premiumTier ? `Tier ${guild.premiumTier}` : "None"}`, | ||||
|             `**❯ Explicit Filter:** ${filterLevels[guild.explicitContentFilter]}`, | ||||
|             `**❯ Verification Level:** ${verificationLevels[guild.verificationLevel]}`, | ||||
|                 `**❯ Time Created:** ${moment(guild.createdTimestamp).format("LT")} ${moment( | ||||
|                     guild.createdTimestamp | ||||
|                 ).format("LL")} ${moment(guild.createdTimestamp).fromNow()}`,
 | ||||
|             `**❯ Time Created:** ${moment(guild.createdTimestamp).format("LT")} ${moment(guild.createdTimestamp).format( | ||||
|                 "LL" | ||||
|             )} ${moment(guild.createdTimestamp).fromNow()}`,
 | ||||
|             "\u200b" | ||||
|         ]) | ||||
|         .addField("Statistics", [ | ||||
|  | @ -234,6 +233,8 @@ async function getGuildInfo(guild: Guild, currentGuild: Guild | null) { | |||
|         ]) | ||||
|         .setTimestamp(); | ||||
| 
 | ||||
|     if (iconURL) embed.setThumbnail(iconURL); | ||||
| 
 | ||||
|     // Only add the roles if the guild the bot is sending the message to is the same one that's being requested.
 | ||||
|     if (displayRoles) { | ||||
|         embed.addField( | ||||
|  | @ -241,7 +242,6 @@ async function getGuildInfo(guild: Guild, currentGuild: Guild | null) { | |||
|             roles.length < 10 ? roles.join(", ") : roles.length > 10 ? trimArray(roles) : "None" | ||||
|         ); | ||||
|     } | ||||
|     } | ||||
| 
 | ||||
|     return embed; | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue