feat: initial prototype
Node.js CI / Lint and Test (push) Successful in 34s

This commit is contained in:
2025-10-04 18:11:37 -07:00
parent e390e6c9fe
commit c7dd989a9e
19 changed files with 5131 additions and 0 deletions
+53
View File
@@ -0,0 +1,53 @@
/**
* @copyright NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import {
ActionRowBuilder,
type ButtonBuilder,
type MessageContextMenuCommandInteraction,
} from "discord.js";
import { addNote } from "../buttons/addNote.js";
import { discord } from "../buttons/discord.js";
import { donate } from "../buttons/donate.js";
/**
* Bookmarks the target message by sending the user a DM with the message link.
* Includes buttons for adding a note and for our Discord and donation links.
* @param interaction - The interaction to handle.
*/
export const bookmark = async(
interaction: MessageContextMenuCommandInteraction,
): Promise<void> => {
await interaction.deferReply({ ephemeral: true });
const { user, targetMessage } = interaction;
const success = await user.
send({
components: [
new ActionRowBuilder<ButtonBuilder>().addComponents(
addNote,
discord,
donate,
),
],
content: targetMessage.url,
}).
catch(() => {
return null;
});
if (success === null) {
await interaction.editReply({
content: "❌ I couldn't send you a DM! Do you have DMs disabled?",
});
return;
}
await interaction.editReply({
content: "✅ I've sent you a DM with the message link!",
});
};