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 iconURL = guild.iconURL({dynamic: true});
|
||||||
const embed = new MessageEmbed().setDescription(`**Guild information for __${guild.name}__**`).setColor("BLUE");
|
const embed = new MessageEmbed().setDescription(`**Guild information for __${guild.name}__**`).setColor("BLUE");
|
||||||
const displayRoles = !!(currentGuild && guild.id === currentGuild.id);
|
const displayRoles = !!(currentGuild && guild.id === currentGuild.id);
|
||||||
if (iconURL) {
|
|
||||||
embed
|
embed
|
||||||
.setThumbnail(iconURL)
|
|
||||||
.addField("General", [
|
.addField("General", [
|
||||||
`**❯ Name:** ${guild.name}`,
|
`**❯ Name:** ${guild.name}`,
|
||||||
`**❯ ID:** ${guild.id}`,
|
`**❯ ID:** ${guild.id}`,
|
||||||
|
@ -207,9 +206,9 @@ async function getGuildInfo(guild: Guild, currentGuild: Guild | null) {
|
||||||
`**❯ Boost Tier:** ${guild.premiumTier ? `Tier ${guild.premiumTier}` : "None"}`,
|
`**❯ Boost Tier:** ${guild.premiumTier ? `Tier ${guild.premiumTier}` : "None"}`,
|
||||||
`**❯ Explicit Filter:** ${filterLevels[guild.explicitContentFilter]}`,
|
`**❯ Explicit Filter:** ${filterLevels[guild.explicitContentFilter]}`,
|
||||||
`**❯ Verification Level:** ${verificationLevels[guild.verificationLevel]}`,
|
`**❯ Verification Level:** ${verificationLevels[guild.verificationLevel]}`,
|
||||||
`**❯ Time Created:** ${moment(guild.createdTimestamp).format("LT")} ${moment(
|
`**❯ Time Created:** ${moment(guild.createdTimestamp).format("LT")} ${moment(guild.createdTimestamp).format(
|
||||||
guild.createdTimestamp
|
"LL"
|
||||||
).format("LL")} ${moment(guild.createdTimestamp).fromNow()}`,
|
)} ${moment(guild.createdTimestamp).fromNow()}`,
|
||||||
"\u200b"
|
"\u200b"
|
||||||
])
|
])
|
||||||
.addField("Statistics", [
|
.addField("Statistics", [
|
||||||
|
@ -234,6 +233,8 @@ async function getGuildInfo(guild: Guild, currentGuild: Guild | null) {
|
||||||
])
|
])
|
||||||
.setTimestamp();
|
.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.
|
// Only add the roles if the guild the bot is sending the message to is the same one that's being requested.
|
||||||
if (displayRoles) {
|
if (displayRoles) {
|
||||||
embed.addField(
|
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"
|
roles.length < 10 ? roles.join(", ") : roles.length > 10 ? trimArray(roles) : "None"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return embed;
|
return embed;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue