guildinfo: guh
This commit is contained in:
parent
93810518ab
commit
58055605fc
1 changed files with 15 additions and 23 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue