feat: initial prototype of app

This commit is contained in:
2025-07-19 15:51:14 -07:00
parent 9523adbc68
commit 3d301122b9
23 changed files with 1556 additions and 5 deletions
+34 -1
View File
@@ -4,4 +4,37 @@
* @author Naomi Carrigan
*/
null;
import {
Client,
Events,
GatewayIntentBits,
} from "discord.js";
import { chatInputInteractionCreate } from "./events/interactionCreate.js";
import { logger } from "./utils/logger.js";
const chibika = new Client({
intents: [
GatewayIntentBits.Guilds,
],
});
chibika.once(Events.ClientReady, () => {
void logger.log(
"debug",
`Logged in as ${chibika.user?.username ?? "unknown"}`,
);
});
chibika.on(Events.InteractionCreate, (interaction) => {
if (interaction.isChatInputCommand()) {
if (!interaction.inCachedGuild()) {
void interaction.reply({
content: "How did you get here? This command is not available in DMs.",
});
return;
}
void chatInputInteractionCreate(chibika, interaction);
}
});
await chibika.login(process.env.DISCORD_TOKEN);