guildinfo: guh

This commit is contained in:
Cynthia Foxwell 2025-04-21 17:42:33 -06:00
parent 93810518ab
commit 58055605fc
Signed by: Cynosphere
SSH key fingerprint: SHA256:H3SM8ufP/uxqLwKSH7xY89TDnbR9uOHzjLoBr0tlajk

View file

@ -71,32 +71,24 @@ 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; let clan = await hf.bot.requestHandler.request("GET", APIEndpoints.CLAN(snowflake), true).catch(() => {});
try {
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;
} else { } else {
const verif = await hf.bot.requestHandler.request( const verif = await hf.bot.requestHandler
"GET", .request("GET", `${APIEndpoints.GUILD_MEMBER_VERIFICATION(snowflake)}?with_guild=true`, true)
`${APIEndpoints.GUILD_MEMBER_VERIFICATION(snowflake)}?with_guild=true`, .catch(() => {});
true
);
if (verif?.profile) { if (verif?.profile) {
clan = verif.profile; clan = verif.profile;
} else if (_guild?.vanityURL) { } else if (_guild?.vanityURL) {
const invite = await hf.bot.requestHandler.request( const invite = await hf.bot.requestHandler
"GET", .request("GET", `${APIEndpoints.INVITE(_guild.vanityURL)}?with_counts=true&with_expiration=true`)
`${APIEndpoints.INVITE(_guild.vanityURL)}?with_counts=true&with_expiration=true` .catch(() => {});
);
if (invite?.profile) clan = invite.profile; if (invite?.profile) clan = invite.profile;
} }
} }
} }
} catch {
// noop
}
if (clan) { if (clan) {
const images = []; const images = [];