From 46948f69e08bb41814a6f8d1767327b0557134a6 Mon Sep 17 00:00:00 2001 From: theimperious1 Date: Fri, 29 Nov 2024 02:20:27 -0500 Subject: [PATCH 1/3] fix(tripsitmode): helpers not being pinged in discussions --- src/discord/commands/global/d.tripsitmode.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/discord/commands/global/d.tripsitmode.ts b/src/discord/commands/global/d.tripsitmode.ts index 0c5fa087e..07add07fd 100644 --- a/src/discord/commands/global/d.tripsitmode.ts +++ b/src/discord/commands/global/d.tripsitmode.ts @@ -227,6 +227,7 @@ async function tripsitmodeOn( const now = new Date(); const diff = now.getTime() - createdDate.getTime(); const minutes = Math.floor(diff / 1000 / 60); + // const seconds = Math.floor(diff / 1000); // Uncomment this for dev server if (minutes > 5) { const helperStr = `and/or ${roleHelper}`; // log.debug(F, `Target has open ticket, and it was created over 5 minutes ago!`); @@ -247,9 +248,15 @@ async function tripsitmodeOn( // If the meta thread exists, update the name and ping the team if (ticketData.meta_thread_id) { let metaMessage = ''; - if (minutes > 5) { + if (minutes > 5) { // Switch to seconds > 10 for dev server const helperString = `and/or ${roleHelper}`; - metaMessage = `Hey ${roleTripsitter} ${guildData.role_helper ?? helperString} team, ${interaction.member} has indicated that ${target.displayName} needs assistance!`; // eslint-disable-line max-len + try { + metaMessage = `Hey ${roleTripsitter} ${guildData.role_helper ? helperString : ''} team, ${target.toString()} has indicated they need assistance!`; + } catch (err) { + // If for example helper role has been deleted but the ID is still stored, do this + metaMessage = `Hey ${roleTripsitter} team, ${target.toString()} has indicated they need assistance!`; + log.error(F, `Stored Helper ID for guild ${guildData.id} is no longer valid. Role is unfetchable or deleted.`); + } } else { metaMessage = `${interaction.member} has indicated that ${target.displayName} needs assistance!`; } From 7a291230ea397f632f05db23d174ee57db567f15 Mon Sep 17 00:00:00 2001 From: theimperious1 Date: Fri, 29 Nov 2024 02:33:15 -0500 Subject: [PATCH 2/3] Accidentally removed team member mention, whoopsie. Fixed --- src/discord/commands/global/d.tripsitmode.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/discord/commands/global/d.tripsitmode.ts b/src/discord/commands/global/d.tripsitmode.ts index 07add07fd..4e08d30d3 100644 --- a/src/discord/commands/global/d.tripsitmode.ts +++ b/src/discord/commands/global/d.tripsitmode.ts @@ -251,10 +251,10 @@ async function tripsitmodeOn( if (minutes > 5) { // Switch to seconds > 10 for dev server const helperString = `and/or ${roleHelper}`; try { - metaMessage = `Hey ${roleTripsitter} ${guildData.role_helper ? helperString : ''} team, ${target.toString()} has indicated they need assistance!`; + metaMessage = `Hey ${roleTripsitter} ${guildData.role_helper ? helperString : ''} team, ${interaction.member} has indicated that ${target.displayName} needs assistance!`; } catch (err) { // If for example helper role has been deleted but the ID is still stored, do this - metaMessage = `Hey ${roleTripsitter} team, ${target.toString()} has indicated they need assistance!`; + metaMessage = `Hey ${roleTripsitter} team, ${interaction.member} has indicated that ${target.displayName} needs assistance!`; log.error(F, `Stored Helper ID for guild ${guildData.id} is no longer valid. Role is unfetchable or deleted.`); } } else { From 4259817bddb167357429a6b17eab0758fca2bf21 Mon Sep 17 00:00:00 2001 From: theimperious1 Date: Tue, 3 Dec 2024 08:58:25 -0500 Subject: [PATCH 3/3] env fix. thought i fixed this already idk. --- .env.example | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 454e22675..17552d75c 100644 --- a/.env.example +++ b/.env.example @@ -59,5 +59,4 @@ WOLFRAM_TOKEN = # For WolframAlpha API IMGUR_ID = # For Imgur API IMGUR_SECRET = # For Imgur API YOUTUBE_TOKEN = # For YouTube API -IMDB_TOKEN = # For IMDB API -``` \ No newline at end of file +IMDB_TOKEN = # For IMDB API \ No newline at end of file