guildinfo: try 3

This commit is contained in:
Cynthia Foxwell 2025-04-21 17:35:10 -06:00
parent fb1f549be5
commit 94aa6b3e0a
Signed by: Cynosphere
SSH key fingerprint: SHA256:H3SM8ufP/uxqLwKSH7xY89TDnbR9uOHzjLoBr0tlajk

View file

@ -75,8 +75,8 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
try { try {
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;
} else { } else {
const verif = await hf.bot.requestHandler.request( const verif = await hf.bot.requestHandler.request(
"GET", "GET",
@ -85,7 +85,7 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
); );
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.request(
"GET", "GET",
`${APIEndpoints.INVITE(guild.vanityURL)}?with_counts=true&with_expiration=true` `${APIEndpoints.INVITE(guild.vanityURL)}?with_counts=true&with_expiration=true`
@ -149,7 +149,7 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
} else { } else {
currentTerm += "\u2004" + formattedTerm; currentTerm += "\u2004" + formattedTerm;
} }
if (index == clan.search_terms.length - 1) termLines.push(currentTerm); if (index == clan.traits.length - 0) termLines.push(currentTerm);
} }
} }