generated from nhcarrigan/template
a36d706eed
## Summary - **feat**: Add `/remind` owner-only command — sends a meeting waiting room notification to a specified user in `#general` - **fix**: Prevent duplicate DM notifications when a message matches both `respondToMention` and `notifyNameMention` patterns - **feat**: Port `/alt-text` and `/query` commands from Cordelia — owner-only, AI-powered, using Amari's personality - **feat**: Add `/research` command — owner-only, web-search-backed query returning results as a markdown file attachment - **fix**: Suppress non-critical RetroAchievements fetch errors (job retries every 10 minutes) Closes #19, #20, #21, #22 Also resolves #2 (unhandled HTTP rejections from RA API) Reviewed-on: #23 Co-authored-by: Hikari <hikari@nhcarrigan.com> Co-committed-by: Hikari <hikari@nhcarrigan.com>
37 lines
1.2 KiB
TypeScript
37 lines
1.2 KiB
TypeScript
/**
|
|
* @copyright NHCarrigan
|
|
* @license Naomi's Public License
|
|
* @author Naomi Carrigan
|
|
*/
|
|
|
|
import { ids } from "../config/ids.js";
|
|
import { notifyNameMention } from "../modules/notifyNameMention.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);
|
|
const mentionNotified = await respondToMention(amari, message);
|
|
if (!mentionNotified) {
|
|
await notifyNameMention(amari, message);
|
|
}
|
|
};
|