mirror of
https://github.com/thedrewen/protojx-manager.git
synced 2026-03-21 09:48:56 +01:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user