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