all repos — stealth-developers @ adf2a1f4e94a5e420bad1b1b4b48ffdae274a4f9

apps/bot/src/index.ts (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
import config from "@stealth-developers/config";

import { logger } from "$/logger";
import { client, kitten } from "@/client";
import { commands, components } from "f/index";

const main = async () => {
	try {
		await client.login(config.discord.token);
	} catch (error) {
		await client.destroy();
		logger.error(error);
		process.exit(1);
	}
};

client.once("clientReady", async (client) => {
	kitten.register({
		commands: commands,
		components: components,
	});

	await kitten.sync();
	logger.info(`logged in as ${client.user.tag}!`);
});

void main();