guildinfo: i may be stupid

This commit is contained in:
Cynthia Foxwell 2025-04-21 17:39:19 -06:00
parent 94aa6b3e0a
commit 93810518ab
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 {
clan = await hf.bot.requestHandler.request("GET", APIEndpoints.CLAN(snowflake), true);
if (!clan) {
if (guild?.profile) {
clan = guild?.profile;
if (_guild?.profile) {
clan = _guild?.profile;
} else {
const verif = await hf.bot.requestHandler.request(
"GET",
@ -85,10 +85,10 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
);
if (verif?.profile) {
clan = verif.profile;
} else if (guild?.vanityURL) {
} else if (_guild?.vanityURL) {
const invite = await hf.bot.requestHandler.request(
"GET",
`${APIEndpoints.INVITE(guild.vanityURL)}?with_counts=true&with_expiration=true`
`${APIEndpoints.INVITE(_guild.vanityURL)}?with_counts=true&with_expiration=true`
);
if (invite?.profile) clan = invite.profile;
}