guildinfo: fix local not resolving profile from vanity
This commit is contained in:
parent
7c82811b4b
commit
89480d98d7
1 changed files with 144 additions and 144 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue