feat(commands): implement follow command with service selection and autocomplete

fix(deploy): initialize and destroy DataSource for command deployment
fix(index): handle autocomplete interactions in command execution
refactor(types): add autocomplete support to CommandDefinition type
fix(Dockerfile): ensure npm run register is executed during build
This commit is contained in:
2025-12-13 18:47:40 +01:00
parent 3d2a1125b3
commit 5fda9afb83
5 changed files with 88 additions and 46 deletions

View File

@@ -2,6 +2,8 @@ import path from "path";
import fs from "fs";
import { configDotenv } from "dotenv";
import { REST, Routes } from "discord.js";
import "reflect-metadata";
import { AppDataSource } from "./data-source";
configDotenv();
@@ -57,6 +59,10 @@ const rest = new REST().setToken(process.env.TOKEN);
(async () => {
try {
// Initialize DataSource first
await AppDataSource.initialize();
console.log("Data Source initialized for command deployment!");
console.log(`Started refreshing ${commands.length} application (/) commands.`);
const data = await rest.put(
@@ -65,6 +71,10 @@ const rest = new REST().setToken(process.env.TOKEN);
) as any[];
console.log(`Successfully reloaded ${data.length} application (/) commands.`);
// Close the connection
await AppDataSource.destroy();
process.exit(0);
} catch (error) {
console.error('[ERROR] Failed to deploy commands:', error);
process.exit(1);