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

This commit is contained in:
2025-08-19 17:16:42 -07:00
parent b9579fede0
commit a05de6ba2a
18 changed files with 5164 additions and 0 deletions
+63
View File
@@ -0,0 +1,63 @@
/**
* @copyright NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import type { User, APIMessageTopLevelComponent } from "discord.js";
/**
* Generates the components to forward a message to Naomi.
* @param author -- The user object that created the message.
* @param content -- The text content of the message.
* @param url -- The link to the message.
* @returns An array of message component objects.
*/
export const getComponentsForNaomi
= (
author: User,
content: string,
url: string,
): Array<APIMessageTopLevelComponent> => {
return [
{
components: [
{
accessory: {
description: null,
media: {
url: author.displayAvatarURL(),
},
spoiler: false,
type: 11,
},
components: [
{
content: `# Message from ${author.displayName}!`,
type: 10,
},
{
content: content,
type: 10,
},
],
type: 9,
},
],
spoiler: false,
type: 17,
},
{
components: [
{
disabled: false,
label: "View Message",
style: 5,
type: 2,
url: url,
},
],
type: 1,
},
];
};
+12
View File
@@ -0,0 +1,12 @@
/**
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import { Logger } from "@nhcarrigan/logger";
export const logger = new Logger(
"Amari",
process.env.LOG_TOKEN ?? "",
);