generated from nhcarrigan/template
This commit is contained in:
@@ -9,6 +9,7 @@ export const ids = {
|
||||
mentorshipGoalForum: "1400629118110011526",
|
||||
mentorshipProjectForum: "1400616702265266186",
|
||||
news: "1407804798677418198",
|
||||
resumeReviewForum: "1407807555266154496",
|
||||
},
|
||||
roles: {
|
||||
nhcarrigan: "1355033209037127771",
|
||||
@@ -22,6 +23,10 @@ export const ids = {
|
||||
member: "1406355801983025183",
|
||||
naomi: "1406355770336870420",
|
||||
},
|
||||
resume: {
|
||||
member: "1407807699718111292",
|
||||
naomi: "1407807752549699727",
|
||||
},
|
||||
},
|
||||
users: {
|
||||
amari: "1406431359345496255",
|
||||
|
||||
@@ -9,6 +9,25 @@ import { logger } from "../utils/logger.js";
|
||||
import type { Amari } from "../interfaces/amari.js";
|
||||
import type { Message } from "discord.js";
|
||||
|
||||
const getTag = (id: string, type: "naomi" | "member"): string => {
|
||||
if (id === ids.channels.mentorshipGoalForum) {
|
||||
return type === "naomi"
|
||||
? ids.tags.goal.naomi
|
||||
: ids.tags.goal.member;
|
||||
}
|
||||
if (id === ids.channels.mentorshipProjectForum) {
|
||||
return type === "naomi"
|
||||
? ids.tags.project.naomi
|
||||
: ids.tags.project.member;
|
||||
}
|
||||
if (id === ids.channels.resumeReviewForum) {
|
||||
return type === "naomi"
|
||||
? ids.tags.resume.naomi
|
||||
: ids.tags.resume.member;
|
||||
}
|
||||
return "";
|
||||
};
|
||||
|
||||
/**
|
||||
* Processes a message in a mentorship thread. Applies either
|
||||
* the `waiting on member` tag or the `waiting on naomi` tag,
|
||||
@@ -16,7 +35,6 @@ import type { Message } from "discord.js";
|
||||
* @param _amari -- Amari's instance.
|
||||
* @param message -- The guild message payload from Discord.
|
||||
*/
|
||||
// eslint-disable-next-line complexity -- Fuck off.
|
||||
export const updateMentorshipThread = async(
|
||||
_amari: Amari,
|
||||
message: Message<true>,
|
||||
@@ -26,19 +44,20 @@ export const updateMentorshipThread = async(
|
||||
if (!channel.isThread() || channel.parent?.isThreadOnly() !== true) {
|
||||
return;
|
||||
}
|
||||
const { mentorshipGoalForum, mentorshipProjectForum } = ids.channels;
|
||||
const {
|
||||
mentorshipGoalForum,
|
||||
mentorshipProjectForum,
|
||||
resumeReviewForum,
|
||||
} = ids.channels;
|
||||
if (![
|
||||
mentorshipGoalForum,
|
||||
mentorshipProjectForum,
|
||||
resumeReviewForum,
|
||||
].includes(channel.parent.id)) {
|
||||
return;
|
||||
}
|
||||
const memberTag = channel.parentId === mentorshipGoalForum
|
||||
? ids.tags.goal.member
|
||||
: ids.tags.project.member;
|
||||
const naomiTag = channel.parentId === mentorshipGoalForum
|
||||
? ids.tags.goal.naomi
|
||||
: ids.tags.project.naomi;
|
||||
const memberTag = getTag(channel.parent.id, "member");
|
||||
const naomiTag = getTag(channel.parent.id, "naomi");
|
||||
if (author.id === ids.users.naomi) {
|
||||
if (channel.appliedTags.includes(memberTag)) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user