From 322419198a047055c38ba066f08ce5722ade2ef3 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Tue, 11 Mar 2025 12:46:16 -0600 Subject: [PATCH 1/4] guildinfo: fix clans --- src/modules/utility/guildinfo.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/utility/guildinfo.js b/src/modules/utility/guildinfo.js index d940a53..e861898 100644 --- a/src/modules/utility/guildinfo.js +++ b/src/modules/utility/guildinfo.js @@ -77,8 +77,9 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) { if (clan) { const images = []; + const game_ids = clan.game_ids ?? clan.game_application_ids ?? []; 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)) .map(async (id) => { let game = Games.find((x) => x.id == id); @@ -193,7 +194,7 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) { } if (!_guild) { - if (clanEmbed) { + if (clanEmbed != null) { return {embeds: [clanEmbed]}; } else { try { From 7b2c6e110a042ae427dd8d220d4a8b9cbd4cde8b Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Tue, 11 Mar 2025 12:49:30 -0600 Subject: [PATCH 2/4] guildinfo.clan: show guild icon if no guild --- src/modules/utility/guildinfo.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/utility/guildinfo.js b/src/modules/utility/guildinfo.js index e861898..6c57b5d 100644 --- a/src/modules/utility/guildinfo.js +++ b/src/modules/utility/guildinfo.js @@ -166,6 +166,7 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) { inline: true, }, ].filter((x) => !!x), + thumbnail: !_guild ? {url: CDNEndpoints.GUILD_ICON(clan.id, clan.icon_hash)} : null, footer: !_guild ? {text: "Fetched from clan"} : null, }; From 80b24a916c7964e0be8724a0d3c1580dfa49a2ea Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Tue, 11 Mar 2025 13:06:49 -0600 Subject: [PATCH 3/4] fix missing hours if days in formatTime --- src/util/time.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/time.js b/src/util/time.js index 74f4b87..c29bc5f 100644 --- a/src/util/time.js +++ b/src/util/time.js @@ -9,7 +9,7 @@ function formatTime(number) { return ( (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")}` ); } From 4ec730fed0cb7f6b5abfd169ea292f3245570a99 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Tue, 11 Mar 2025 13:10:13 -0600 Subject: [PATCH 4/4] formatTime try 2 --- src/util/time.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/time.js b/src/util/time.js index c29bc5f..0eefcc1 100644 --- a/src/util/time.js +++ b/src/util/time.js @@ -9,7 +9,7 @@ function formatTime(number) { return ( (days !== 0 ? `${days.toString().padStart(2, "0")}:` : "") + - (days !== 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")}` ); }