Skip to content

Commit

Permalink
feat: simplify apps
Browse files Browse the repository at this point in the history
  • Loading branch information
sgoodrow committed Aug 30, 2024
1 parent a32d96e commit b51be33
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 92 deletions.
63 changes: 0 additions & 63 deletions src/features/applications/config.ts

This file was deleted.

13 changes: 5 additions & 8 deletions src/features/applications/request-application-button-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@ import { requestDumpThreadId } from "../../config";
import { ButtonCommand } from "../../shared/command/button-command";

export class RequestApplication extends ButtonCommand {
public constructor(
private readonly role: string,
private readonly description: string
) {
super(`request${role}Application`);
public constructor() {
super("volunteer-application");
}

public get label() {
return `${this.role} Application`;
return "Volunteer Application";
}

public async execute(interaction: ButtonInteraction<CacheType>) {
Expand Down Expand Up @@ -53,9 +50,9 @@ export class RequestApplication extends ButtonCommand {
private get content() {
return `**DO NOT REPLY TO THIS MESSAGE.**
In Castle, leadership and volunteering are duties with no special privileges. ${this.role}s are tasked with ${this.description}. Volunteers may step down at any time.
In Castle, leadership and volunteering are duties with no special privileges. Volunteers may step down at any time.
**How do I apply to be a ${this.role}?**
**How do I apply?**
Fill out the following Google form: https://docs.google.com/forms/d/e/1FAIpQLSelYSgoouJCOIV9qoOQ1FdOXj8oGC2pfv7P47iUUd1hjOic-g/viewform.
**What happens to an application?**
Expand Down
35 changes: 14 additions & 21 deletions src/features/applications/update-applications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ import {
MessageActionRowComponentBuilder,
ButtonStyle,
} from "discord.js";
import { chunk } from "lodash";
import { applicationsChannelId } from "../../config";
import { Name } from "../../db/instructions";
import { InstructionsReadyAction } from "../../shared/action/instructions-ready-action";
import {
readyActionExecutor,
ReadyActionExecutorOptions,
} from "../../shared/action/ready-action";
import { castleOnlyRoles, castleOrAllyRoles } from "./config";
import { RequestApplication } from "./request-application-button-commands";

const applicationButton = new RequestApplication();

export const updateApplicationInfo = (
client: Client,
Expand All @@ -27,13 +28,14 @@ class UpdateApplicationInfoAction extends InstructionsReadyAction {
embeds: [this.volunteerRoles()],
// There is a limit of 5 buttons per action row. (hence: chunk)
// There is a limit of 5 action rows. (note: no protection for this yet)
components: chunk(this.getButtons(), 5).map(
(buttons) =>
new ActionRowBuilder<MessageActionRowComponentBuilder>({
type: 1,
components: buttons,
})
),
components: [
new ActionRowBuilder<MessageActionRowComponentBuilder>({
type: 1,
components: [
applicationButton.getButtonBuilder(ButtonStyle.Secondary),
],
}),
],
},
Name.ApplicationInstructions
);
Expand All @@ -50,29 +52,20 @@ class UpdateApplicationInfoAction extends InstructionsReadyAction {
❓ **What's expected of volunteers?**
• Represent us well, both internally and externally.
• Commit as much time as you like, when you'd like.
• You may take a break or step down at any time, but may be required to re-apply for Leadership roles.
• You may take a break or step down at any time, but you will be required to re-apply if you become interested again.
❓ **Am I a good candidate to volunteer? What if I'm an ally?**
• Yes! Everyone is encouraged to volunteer.
• All roles are open to alliance members except :red_square: **Officer** and :red_square: **Guard**.
• All roles are open to alliance members except :red_square: **Officer** and :red_square: **Guard**, which are Castle-members only.
📜 **How do I apply?**
• Press one of the buttons below to receive a copy of the role's application in a DM.
• Press the button below to receive a link to the volunteer application in a DM.
• Retrieving the application is not a commitment to apply!
✨ _"Many hands make light work!"_ ✨`,
});
}

private getButtons() {
return [
...castleOrAllyRoles.map((r) =>
r.getButtonBuilder(ButtonStyle.Secondary)
),
...castleOnlyRoles.map((r) => r.getButtonBuilder(ButtonStyle.Danger)),
];
}

protected get channel() {
return this.getChannel(applicationsChannelId, "applications");
}
Expand Down

0 comments on commit b51be33

Please sign in to comment.