guildinfo: fix local not resolving profile from vanity

This commit is contained in:
Cynthia Foxwell 2025-04-21 17:58:11 -06:00
parent 7c82811b4b
commit 89480d98d7
Signed by: Cynosphere
SSH key fingerprint: SHA256:H3SM8ufP/uxqLwKSH7xY89TDnbR9uOHzjLoBr0tlajk

View file

@ -70,14 +70,15 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
const snowflake = line.match(SNOWFLAKE_REGEX)[1]; const snowflake = line.match(SNOWFLAKE_REGEX)[1];
_guild = await getGuild(snowflake, nolocal); _guild = await getGuild(snowflake, nolocal);
id = snowflake; id = snowflake;
}
let clan = await hf.bot.requestHandler.request("GET", APIEndpoints.CLAN(snowflake), true).catch(() => {}); let clan = await hf.bot.requestHandler.request("GET", APIEndpoints.CLAN(id), true).catch(() => {});
if (!clan) { if (!clan) {
if (_guild?.profile) { if (_guild?.profile) {
clan = _guild?.profile; clan = _guild?.profile;
} else { } else {
const verif = await hf.bot.requestHandler const verif = await hf.bot.requestHandler
.request("GET", `${APIEndpoints.GUILD_MEMBER_VERIFICATION(snowflake)}?with_guild=true`, true) .request("GET", `${APIEndpoints.GUILD_MEMBER_VERIFICATION(id)}?with_guild=true`, true)
.catch(() => {}); .catch(() => {});
if (verif?.profile) { if (verif?.profile) {
clan = verif.profile; clan = verif.profile;
@ -225,7 +226,6 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
}); });
} }
} }
}
if (!_guild) { if (!_guild) {
if (clanEmbed != null) { if (clanEmbed != null) {