Files
amari/src/events/handleMessageCreate.ts
T
naomi 7facefccd8
Node.js CI / Lint and Test (push) Successful in 48s
feat: track when naomi is recently active
2025-09-02 14:14:03 -07: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);
};