Files
amari/src/events/handleMessageCreate.ts
T
naomi 34d71c73aa
Node.js CI / Lint and Test (push) Successful in 50s
feat: remove bullying because science did her resume
And I am very proud of her!
2025-11-12 10:05:50 -08:00

33 lines
1012 B
TypeScript

/**
* @copyright NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import { ids } from "../config/ids.js";
import { respondToMention } from "../modules/respondToMention.js";
import { updateMentorshipThread } from "../modules/updateMentorshipThread.js";
import type { Amari } from "../interfaces/amari.js";
import type { Message } from "discord.js";
/**
* Handles the message create event from Discord.
* Bootstraps all of our custom logic modules.
* @param amari -- Amari's instance.
* @param message -- The guild message payload from Discord.
*/
export const handleMessageCreate = async(
amari: Amari,
message: Message<true>,
): Promise<void> => {
if (message.author.bot || message.system) {
return;
}
if (message.author.id === ids.users.naomi
&& !amari.recentlyActiveChannels.has(message.channel.id)) {
amari.recentlyActiveChannels.add(message.channel.id);
}
await updateMentorshipThread(amari, message);
await respondToMention(amari, message);
};