diff --git a/src/features/applications/config.ts b/src/features/applications/config.ts deleted file mode 100644 index 23f769a..0000000 --- a/src/features/applications/config.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { RequestApplication } from "./request-application-button-commands"; - -const officerApplicationCommand = new RequestApplication( - "Officer", - "running the guild" -); - -const guardApplicationCommand = new RequestApplication( - "Guard", - "conducting guild invites, keeping the peace, and optionally running non-raid events" -); - -const knightApplicationCommand = new RequestApplication( - "Knight", - "running, scheduling and supporting guild raids" -); - -const bankerApplicationCommand = new RequestApplication( - "Banker", - "fielding bank requests" -); - -const jewelerApplicationCommand = new RequestApplication( - "Jeweler", - "fielding jewelry requests" -); - -const scribeApplicationCommand = new RequestApplication( - "Scribe", - "ensuring our guild policies and documentation are accurate and accessible" -); - -const dkpDeputyApplicationCommand = new RequestApplication( - "DKP Deputy", - "uploading DKP records and resolving record inaccuracies" -); - -const quarterMasterApplicationCommand = new RequestApplication( - "Quarter Master", - "restocking and recharging shared bot characters" -); - -const otherApplicationCommand = new RequestApplication( - "Other", - "doing things we did not anticipate" -); - -export const castleOnlyRoles = [ - officerApplicationCommand, - guardApplicationCommand, -]; - -export const castleOrAllyRoles = [ - knightApplicationCommand, - scribeApplicationCommand, - dkpDeputyApplicationCommand, - bankerApplicationCommand, - jewelerApplicationCommand, - quarterMasterApplicationCommand, - otherApplicationCommand, -]; - -export const applicationCommands = [...castleOnlyRoles, ...castleOrAllyRoles]; diff --git a/src/features/applications/request-application-button-commands.ts b/src/features/applications/request-application-button-commands.ts index 9801e30..300abaf 100644 --- a/src/features/applications/request-application-button-commands.ts +++ b/src/features/applications/request-application-button-commands.ts @@ -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) { @@ -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?** diff --git a/src/features/applications/update-applications.ts b/src/features/applications/update-applications.ts index 42779d7..db04ca5 100644 --- a/src/features/applications/update-applications.ts +++ b/src/features/applications/update-applications.ts @@ -5,7 +5,6 @@ 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"; @@ -13,7 +12,9 @@ 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, @@ -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({ - type: 1, - components: buttons, - }) - ), + components: [ + new ActionRowBuilder({ + type: 1, + components: [ + applicationButton.getButtonBuilder(ButtonStyle.Secondary), + ], + }), + ], }, Name.ApplicationInstructions ); @@ -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"); }