From 32e8541660491cae1b7a0b4fec805ab92faa029b Mon Sep 17 00:00:00 2001 From: Di Nguyen <61582133+KuroganeToyama@users.noreply.github.com> Date: Fri, 19 Jan 2024 10:29:09 -0500 Subject: [PATCH] Explain the membership process when no UW ID is passed in .member (#504) * Modified .member to have uwid optional, and added membership explanation when no uwid is passed * Changed no UW ID embed to blue, updated no UW ID description and reorganized the descriptions --------- Co-authored-by: Di Nguyen --- src/commandDetails/miscellaneous/member.ts | 30 ++++++++++++++-------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/commandDetails/miscellaneous/member.ts b/src/commandDetails/miscellaneous/member.ts index d2d3c790..e6061fd6 100644 --- a/src/commandDetails/miscellaneous/member.ts +++ b/src/commandDetails/miscellaneous/member.ts @@ -24,11 +24,24 @@ 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. + + Please provide a UW ID to check if you are a CSC member. + + 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('Please provide a UW ID!'); + return new EmbedBuilder().setColor('Blue').setTitle(title).setDescription(EXPLAIN_MEMBERSHIP); } const members = (await (await fetch(MEMBER_API)).json()).members as memberStatus[]; @@ -38,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); }; @@ -82,7 +90,7 @@ export const memberCommandDetails: CodeyCommandDetails = { name: 'uwid', description: 'The Quest ID of the user.', type: CodeyCommandOptionType.STRING, - required: true, + required: false, }, ], subcommandDetails: {},