Skip to content

Commit

Permalink
Explain the membership process when no UW ID is passed in .member (#504)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
KuroganeToyama and KuroganeToyama authored Jan 19, 2024
1 parent c05c019 commit 32e8541
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions src/commandDetails/miscellaneous/member.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,24 @@ type UwIdType = string | undefined;
*/
const getMemberEmbed = async (uwid: UwIdType): Promise<EmbedBuilder> => {
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[];
Expand All @@ -38,14 +51,9 @@ const getMemberEmbed = async (uwid: UwIdType): Promise<EmbedBuilder> => {
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);
};

Expand Down Expand Up @@ -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: {},
Expand Down

0 comments on commit 32e8541

Please sign in to comment.