From 7bc1b606d3e2bd916f4a4eded460fd985cbb8bd7 Mon Sep 17 00:00:00 2001 From: Taken Date: Sun, 31 Dec 2023 17:09:24 +0100 Subject: [PATCH] Updated scrips --- scripts/deploy-commands.ts | 10 ++++++---- scripts/dev-deploy.ts | 11 ++++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/scripts/deploy-commands.ts b/scripts/deploy-commands.ts index c70d2e9..27909a5 100644 --- a/scripts/deploy-commands.ts +++ b/scripts/deploy-commands.ts @@ -1,4 +1,4 @@ -import { REST, RESTGetAPIApplicationGuildCommandResult, RESTPutAPIApplicationCommandsJSONBody, Routes } from "discord.js" +import { REST, RESTPutAPIApplicationCommandsJSONBody, Routes } from "discord.js" import fs from "node:fs" import { Command } from "../src/interfaces" import env from "../src/utils/Env" @@ -21,12 +21,14 @@ for (const file of contentMenuCommands) { try { console.log(`Started refreshing ${commands.length} application (/) commands.`) - const data = await rest.put( + await rest.put( Routes.applicationCommands(env.dev.clientid!), { body: commands }, - ) as RESTGetAPIApplicationGuildCommandResult[] + ).then(() => { + console.log(`Successfully reloaded ${commands.length} application (/) commands.`) + process.exit(0) + }) - console.log(`Successfully reloaded ${data.length} application (/) commands.`) } catch (error) { console.error(error) } diff --git a/scripts/dev-deploy.ts b/scripts/dev-deploy.ts index 1ea6f24..ba5f26c 100644 --- a/scripts/dev-deploy.ts +++ b/scripts/dev-deploy.ts @@ -1,4 +1,4 @@ -import { REST, RESTGetAPIApplicationGuildCommandResult, RESTPutAPIApplicationCommandsJSONBody, Routes } from "discord.js" +import { REST, RESTPutAPIApplicationCommandsJSONBody, Routes } from "discord.js" import fs from "fs" import env from "../src/utils/Env" import { Command } from "../src/interfaces" @@ -25,12 +25,13 @@ for (const file of contentMenuCommands) { try { console.log(`Started refreshing ${commands.length} application (/) commands.`) - const data = await rest.put( + await rest.put( Routes.applicationGuildCommands(env.dev.devid!, env.dev.guildid!), { body: commands }, - ) as RESTGetAPIApplicationGuildCommandResult[] - - console.log(`Successfully reloaded ${data.length} application (/) commands.`) + ).then(() => { + console.log(`Successfully reloaded ${commands.length} application (/) commands.`) + process.exit(0) + }) } catch (error) { console.error(error) }