Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain the membership process when no UW ID is passed in .member #504

Merged
merged 2 commits into from
Jan 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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