guildinfo: resolve clan game ids
This commit is contained in:
parent
f0d36959c9
commit
50d36a650f
1 changed files with 14 additions and 2 deletions
|
@ -9,6 +9,7 @@ const {
|
||||||
CDNEndpoints,
|
CDNEndpoints,
|
||||||
ClanPlaystyle,
|
ClanPlaystyle,
|
||||||
ExplicitContentFilterStrings,
|
ExplicitContentFilterStrings,
|
||||||
|
Games,
|
||||||
Permissions,
|
Permissions,
|
||||||
VerificationLevelStrings,
|
VerificationLevelStrings,
|
||||||
} = require("../../util/dconstants.js");
|
} = require("../../util/dconstants.js");
|
||||||
|
@ -76,6 +77,17 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
|
||||||
if (clan) {
|
if (clan) {
|
||||||
const images = [];
|
const images = [];
|
||||||
|
|
||||||
|
const games = await Promise.all(
|
||||||
|
clan.game_ids.map(async (id) => {
|
||||||
|
let game = Games.find((x) => x.id == id);
|
||||||
|
if (!game) {
|
||||||
|
game = await hf.bot.requestHandler.request("GET", APIEndpoints.APPLICATION_RPC(snowflake), false);
|
||||||
|
}
|
||||||
|
|
||||||
|
return `${game.name} (\`${id}\`)`;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
clanEmbed = {
|
clanEmbed = {
|
||||||
title: _guild != null ? "Clan data" : clan.name,
|
title: _guild != null ? "Clan data" : clan.name,
|
||||||
description: clan.description ?? "*No description*",
|
description: clan.description ?? "*No description*",
|
||||||
|
@ -106,8 +118,8 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
|
||||||
inline: false,
|
inline: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Associated Game IDs",
|
name: "Associated Games",
|
||||||
value: `\`${clan.game_ids.map((x) => `"${x}"`).join(", ")}\``,
|
value: `- ${games.join("\n- ")}`,
|
||||||
inline: false,
|
inline: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue