diff --git a/src/modules/utility/guildinfo.js b/src/modules/utility/guildinfo.js index f9b3c6c..bae1c9f 100644 --- a/src/modules/utility/guildinfo.js +++ b/src/modules/utility/guildinfo.js @@ -71,31 +71,23 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) { _guild = await getGuild(snowflake, nolocal); id = snowflake; - let clan; - try { - clan = await hf.bot.requestHandler.request("GET", APIEndpoints.CLAN(snowflake), true); - if (!clan) { - if (_guild?.profile) { - clan = _guild?.profile; - } else { - const verif = await hf.bot.requestHandler.request( - "GET", - `${APIEndpoints.GUILD_MEMBER_VERIFICATION(snowflake)}?with_guild=true`, - true - ); - if (verif?.profile) { - clan = verif.profile; - } else if (_guild?.vanityURL) { - const invite = await hf.bot.requestHandler.request( - "GET", - `${APIEndpoints.INVITE(_guild.vanityURL)}?with_counts=true&with_expiration=true` - ); - if (invite?.profile) clan = invite.profile; - } + let clan = await hf.bot.requestHandler.request("GET", APIEndpoints.CLAN(snowflake), true).catch(() => {}); + if (!clan) { + if (_guild?.profile) { + clan = _guild?.profile; + } else { + const verif = await hf.bot.requestHandler + .request("GET", `${APIEndpoints.GUILD_MEMBER_VERIFICATION(snowflake)}?with_guild=true`, true) + .catch(() => {}); + if (verif?.profile) { + clan = verif.profile; + } else if (_guild?.vanityURL) { + const invite = await hf.bot.requestHandler + .request("GET", `${APIEndpoints.INVITE(_guild.vanityURL)}?with_counts=true&with_expiration=true`) + .catch(() => {}); + if (invite?.profile) clan = invite.profile; } } - } catch { - // noop } if (clan) {