a402c7b0bb
- Add package.json with dependencies and scripts for building, testing, and running the bot. - Implement bot startup logic in src/bot.ts, handling interactions and commands. - Create command structure in src/commands/index.ts, including a ping command in src/commands/ping.ts. - Add configuration loading from environment variables in src/config.ts. - Implement command registration in Discord API in src/deploy-commands.ts. - Bootstrap the bot in src/index.ts. - Configure TypeScript settings in tsconfig.json.
15 lines
342 B
TypeScript
15 lines
342 B
TypeScript
import { startBot } from "./bot";
|
|
import { loadConfig } from "./config";
|
|
|
|
export async function bootstrap(): Promise<void> {
|
|
const config = loadConfig();
|
|
await startBot(config);
|
|
}
|
|
|
|
if (require.main === module) {
|
|
void bootstrap().catch((error: unknown) => {
|
|
console.error("Failed to start bot:", error);
|
|
process.exit(1);
|
|
});
|
|
}
|