Skip to content
Open
Show file tree
Hide file tree
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
15 changes: 12 additions & 3 deletions src/commands/StartPronouns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ class StartPronouns extends BaseCommand {
.setName("other_role")
.setDescription("The other role.")
.setRequired(true),
)
.addRoleOption((option) =>
option
.setName("hide_role")
.setDescription("The prefer not to disclose role.")
.setRequired(true),
);
}

Expand All @@ -61,6 +67,7 @@ class StartPronouns extends BaseCommand {
const sheHerRole = interaction.options.getRole("she_her_role")!;
const theyThemRole = interaction.options.getRole("they_them_role")!;
const otherRole = interaction.options.getRole("other_role")!;
const hideRole = interaction.options.getRole("hide_role")!;

const message = await channel.send({ embeds: [this.makePronounsEmbed()] });
PRONOUN_REACTION_EMOJIS.forEach((emoji) => message.react(emoji));
Expand All @@ -80,6 +87,7 @@ class StartPronouns extends BaseCommand {
sheHerRole: sheHerRole.id,
theyThemRole: theyThemRole.id,
otherRole: otherRole.id,
hideRole: hideRole.id
},
savedMessage: {
messageId: message.id,
Expand All @@ -93,9 +101,10 @@ class StartPronouns extends BaseCommand {
.setTitle("Set your pronouns by reacting to one or more of the emojis!")
.setDescription(
`${PRONOUN_REACTION_EMOJIS[0]} he/him\n` +
`${PRONOUN_REACTION_EMOJIS[1]} she/her\n` +
`${PRONOUN_REACTION_EMOJIS[2]} they/them\n` +
`${PRONOUN_REACTION_EMOJIS[3]} other pronouns\n`,
`${PRONOUN_REACTION_EMOJIS[1]} she/her\n` +
`${PRONOUN_REACTION_EMOJIS[2]} they/them\n` +
`${PRONOUN_REACTION_EMOJIS[3]} other pronouns\n` +
`${PRONOUN_REACTION_EMOJIS[4]} prefer not to disclose\n`,
);
}
}
Expand Down
10 changes: 8 additions & 2 deletions src/listeners/pronouns/PronounsReactionAdd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@ class PronounsReactionAdd extends Listener<typeof Events.MessageReactionAdd> {
const { savedMessage } = pronounsDocData;
if (reaction.message.id !== savedMessage.messageId) return;

const { heHimRole, sheHerRole, theyThemRole, otherRole } =
const { heHimRole, sheHerRole, theyThemRole, otherRole, hideRole } =
pronounsDocData.roleIds;

const roleOrder = [heHimRole, sheHerRole, theyThemRole, otherRole];
const roleOrder = [
heHimRole,
sheHerRole,
theyThemRole,
otherRole,
hideRole,
].filter(Boolean);

const roleIndex = PRONOUN_REACTION_EMOJIS.findIndex(
(emoji) => emoji === reaction.emoji.name,
Expand Down
10 changes: 8 additions & 2 deletions src/listeners/pronouns/PronounsReactionRemove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,16 @@ class PronounsReactionRemove extends Listener<
const { savedMessage } = pronounsDocData;
if (reaction.message.id !== savedMessage.messageId) return;

const { heHimRole, sheHerRole, theyThemRole, otherRole } =
const { heHimRole, sheHerRole, theyThemRole, otherRole, hideRole } =
pronounsDocData.roleIds;

const roleOrder = [heHimRole, sheHerRole, theyThemRole, otherRole];
const roleOrder = [
heHimRole,
sheHerRole,
theyThemRole,
otherRole,
hideRole,
].filter(Boolean);

const roleIndex = PRONOUN_REACTION_EMOJIS.findIndex(
(emoji) => emoji === reaction.emoji.name,
Expand Down
3 changes: 2 additions & 1 deletion src/types/db/pronouns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ export interface PronounsDoc {
sheHerRole: string;
theyThemRole: string;
otherRole: string;
hideRole: string;
};
savedMessage: SavedMessage;
}

export const PRONOUN_REACTION_EMOJIS = ["1️⃣", "2️⃣", "3️⃣", "4️⃣"];
export const PRONOUN_REACTION_EMOJIS = ["1️⃣", "2️⃣", "3️⃣", "4️⃣", "5️⃣"];