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
+39
View File
@@ -0,0 +1,39 @@
/**
* @copyright NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import { Client, GatewayIntentBits, Events, Partials } from "discord.js";
import { handleMessageCreate } from "./events/handleMessageCreate.js";
import { respondToDm } from "./modules/respondToDm.js";
import { instantiateServer } from "./server/serve.js";
import { logger } from "./utils/logger.js";
import type { Amari } from "./interfaces/amari.js";
const amari: Amari = {
discord: new Client({ intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.DirectMessages,
],
partials: [ Partials.Channel ] }),
};
amari.discord.once(Events.ClientReady, () => {
void logger.log("debug",
`Authenticated to Discord as ${amari.discord.user?.username ?? "unknown"}`);
});
amari.discord.on(Events.MessageCreate, (message) => {
if (!message.inGuild()) {
void respondToDm(amari, message);
return;
}
void handleMessageCreate(amari, message);
});
await amari.discord.login(process.env.BOT_TOKEN);
instantiateServer();