guildinfo: try 2
This commit is contained in:
parent
58183ab07a
commit
fb1f549be5
1 changed files with 135 additions and 133 deletions
|
@ -71,8 +71,9 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
|
||||||
_guild = await getGuild(snowflake, nolocal);
|
_guild = await getGuild(snowflake, nolocal);
|
||||||
id = snowflake;
|
id = snowflake;
|
||||||
|
|
||||||
|
let clan;
|
||||||
try {
|
try {
|
||||||
let clan = await hf.bot.requestHandler.request("GET", APIEndpoints.CLAN(snowflake), true);
|
clan = await hf.bot.requestHandler.request("GET", APIEndpoints.CLAN(snowflake), true);
|
||||||
if (!clan) {
|
if (!clan) {
|
||||||
if (guild.profile) {
|
if (guild.profile) {
|
||||||
clan = guild.profile;
|
clan = guild.profile;
|
||||||
|
@ -93,6 +94,9 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch {
|
||||||
|
// noop
|
||||||
|
}
|
||||||
|
|
||||||
if (clan) {
|
if (clan) {
|
||||||
const images = [];
|
const images = [];
|
||||||
|
@ -165,9 +169,12 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
|
||||||
author: {
|
author: {
|
||||||
name: clan.tag,
|
name: clan.tag,
|
||||||
},
|
},
|
||||||
description: `-# :video_game:${ClanPlaystyle[clan.playstyle] ?? "Unknown"}${
|
description:
|
||||||
|
clan.playstyle || clan.wildcard_descriptors
|
||||||
|
? `-# :video_game:${ClanPlaystyle[clan.playstyle] ?? "Unknown"}${
|
||||||
clan.wildcard_descriptors.length > 0 ? ` \u2022 **${clan.wildcard_descriptors.join(", ")}**` : ""
|
clan.wildcard_descriptors.length > 0 ? ` \u2022 **${clan.wildcard_descriptors.join(", ")}**` : ""
|
||||||
}\n\n${clan.description ?? "*No description*"}`,
|
}\n\n${clan.description ?? "*No description*"}`
|
||||||
|
: clan.description ?? "*No description*",
|
||||||
fields: [
|
fields: [
|
||||||
!_guild && {
|
!_guild && {
|
||||||
name: "Member Count",
|
name: "Member Count",
|
||||||
|
@ -196,9 +203,7 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
|
||||||
},
|
},
|
||||||
clan.brand_color_primary && {
|
clan.brand_color_primary && {
|
||||||
name: "Banner/Brand Colors",
|
name: "Banner/Brand Colors",
|
||||||
value: `${clan.brand_color_primary}${
|
value: `${clan.brand_color_primary}${clan.brand_color_secondary ? `, ${clan.brand_color_secondary}` : ""}`,
|
||||||
clan.brand_color_secondary ? `, ${clan.brand_color_secondary}` : ""
|
|
||||||
}`,
|
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
].filter((x) => !!x),
|
].filter((x) => !!x),
|
||||||
|
@ -225,9 +230,6 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch {
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_guild) {
|
if (!_guild) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue