Compare commits

..

4 commits

2 changed files with 5 additions and 3 deletions

View file

@ -77,8 +77,9 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
if (clan) { if (clan) {
const images = []; const images = [];
const game_ids = clan.game_ids ?? clan.game_application_ids ?? [];
const games = await Promise.all( const games = await Promise.all(
clan.game_ids game_ids
.sort((a, b) => (clan.game_activity[b]?.activity_score ?? 0) - (clan.game_activity[a]?.activity_score ?? 0)) .sort((a, b) => (clan.game_activity[b]?.activity_score ?? 0) - (clan.game_activity[a]?.activity_score ?? 0))
.map(async (id) => { .map(async (id) => {
let game = Games.find((x) => x.id == id); let game = Games.find((x) => x.id == id);
@ -165,6 +166,7 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
inline: true, inline: true,
}, },
].filter((x) => !!x), ].filter((x) => !!x),
thumbnail: !_guild ? {url: CDNEndpoints.GUILD_ICON(clan.id, clan.icon_hash)} : null,
footer: !_guild ? {text: "Fetched from clan"} : null, footer: !_guild ? {text: "Fetched from clan"} : null,
}; };
@ -193,7 +195,7 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
} }
if (!_guild) { if (!_guild) {
if (clanEmbed) { if (clanEmbed != null) {
return {embeds: [clanEmbed]}; return {embeds: [clanEmbed]};
} else { } else {
try { try {

View file

@ -9,7 +9,7 @@ function formatTime(number) {
return ( return (
(days !== 0 ? `${days.toString().padStart(2, "0")}:` : "") + (days !== 0 ? `${days.toString().padStart(2, "0")}:` : "") +
(hours !== 0 ? `${hours.toString().padStart(2, "0")}:` : "") + (days !== 0 || hours !== 0 ? `${hours.toString().padStart(2, "0")}:` : "") +
`${minutes.toString().padStart(2, "0")}:${seconds.toString().padStart(2, "0")}` `${minutes.toString().padStart(2, "0")}:${seconds.toString().padStart(2, "0")}`
); );
} }