From e708d3e6d7a9f0dee89b8fccac4ec70b6e736780 Mon Sep 17 00:00:00 2001 From: Di Nguyen Date: Thu, 18 Jan 2024 19:54:17 +0000 Subject: [PATCH 1/2] Modified .member to have uwid optional, and added membership explanation when no uwid is passed --- src/commandDetails/miscellaneous/member.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/commandDetails/miscellaneous/member.ts b/src/commandDetails/miscellaneous/member.ts index d2d3c790..cc547722 100644 --- a/src/commandDetails/miscellaneous/member.ts +++ b/src/commandDetails/miscellaneous/member.ts @@ -24,11 +24,20 @@ type UwIdType = string | undefined; */ const getMemberEmbed = async (uwid: UwIdType): Promise => { const title = 'CSC Membership Information'; + const EXPLAIN_MEMBERSHIP = `Oops! You didn't provide a UW ID. + + If you're already a CSC member, please provide a UW ID. + + If not, perhaps you're interested in becoming one? + + Being a CSC member comes with gaining access to CSC machines, cloud, email, web hosting, and more! Additional details can be found here! https://csclub.uwaterloo.ca/resources/services/ + + To sign up, you can follow the instructions here! https://csclub.uwaterloo.ca/get-involved/`; if (!uwid) { return new EmbedBuilder() .setColor('Red') .setTitle(title) - .setDescription('Please provide a UW ID!'); + .setDescription(EXPLAIN_MEMBERSHIP); } const members = (await (await fetch(MEMBER_API)).json()).members as memberStatus[]; @@ -82,7 +91,7 @@ export const memberCommandDetails: CodeyCommandDetails = { name: 'uwid', description: 'The Quest ID of the user.', type: CodeyCommandOptionType.STRING, - required: true, + required: false, }, ], subcommandDetails: {}, From 3a52fd76c927ded8f183c0f0eb4d726e0590406c Mon Sep 17 00:00:00 2001 From: Di Nguyen Date: Fri, 19 Jan 2024 15:05:28 +0000 Subject: [PATCH 2/2] Changed no UW ID embed to blue, updated no UW ID description and reorganized the descriptions --- src/commandDetails/miscellaneous/member.ts | 23 +++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/commandDetails/miscellaneous/member.ts b/src/commandDetails/miscellaneous/member.ts index cc547722..e6061fd6 100644 --- a/src/commandDetails/miscellaneous/member.ts +++ b/src/commandDetails/miscellaneous/member.ts @@ -26,18 +26,22 @@ const getMemberEmbed = async (uwid: UwIdType): Promise => { const title = 'CSC Membership Information'; const EXPLAIN_MEMBERSHIP = `Oops! You didn't provide a UW ID. - If you're already a CSC member, please provide a UW ID. + Please provide a UW ID to check if you are a CSC member. - If not, perhaps you're interested in becoming one? + If you are not, are you interested in being one? Being a CSC member comes with gaining access to CSC machines, cloud, email, web hosting, and more! Additional details can be found here! https://csclub.uwaterloo.ca/resources/services/ To sign up, you can follow the instructions here! https://csclub.uwaterloo.ca/get-involved/`; + const IS_MEMBER_DESCRIPTION = `You're a CSC member! Hooray! ${getEmojiByName('codey_love')}`; + const NOT_MEMBER_DESCRIPTION = `You're not a CSC member! ${getEmojiByName('codey_sad')} + + Being a CSC member comes with gaining access to CSC machines, cloud, email, web hosting, and more! Additional details can be found here! https://csclub.uwaterloo.ca/resources/services/ + + To sign up, you can follow the instructions here! https://csclub.uwaterloo.ca/get-involved/`; + if (!uwid) { - return new EmbedBuilder() - .setColor('Red') - .setTitle(title) - .setDescription(EXPLAIN_MEMBERSHIP); + return new EmbedBuilder().setColor('Blue').setTitle(title).setDescription(EXPLAIN_MEMBERSHIP); } const members = (await (await fetch(MEMBER_API)).json()).members as memberStatus[]; @@ -47,14 +51,9 @@ const getMemberEmbed = async (uwid: UwIdType): Promise => { return new EmbedBuilder() .setColor('Green') .setTitle(title) - .setDescription(`You're a CSC member! Hooray! ${getEmojiByName('codey_love')}`); + .setDescription(IS_MEMBER_DESCRIPTION); } - const NOT_MEMBER_DESCRIPTION = `You're not a CSC member! ${getEmojiByName('codey_sad')} - -Being a CSC member comes with gaining access to CSC machines, cloud, email, web hosting, and more! Additional details can be found here! https://csclub.uwaterloo.ca/resources/services/ - -To sign up, you can follow the instructions here! https://csclub.uwaterloo.ca/get-involved/`; return new EmbedBuilder().setColor('Red').setTitle(title).setDescription(NOT_MEMBER_DESCRIPTION); };