Updated scrips
This commit is contained in:
@@ -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 fs from "node:fs"
|
||||||
import { Command } from "../src/interfaces"
|
import { Command } from "../src/interfaces"
|
||||||
import env from "../src/utils/Env"
|
import env from "../src/utils/Env"
|
||||||
@@ -21,12 +21,14 @@ for (const file of contentMenuCommands) {
|
|||||||
try {
|
try {
|
||||||
console.log(`Started refreshing ${commands.length} application (/) commands.`)
|
console.log(`Started refreshing ${commands.length} application (/) commands.`)
|
||||||
|
|
||||||
const data = await rest.put(
|
await rest.put(
|
||||||
Routes.applicationCommands(env.dev.clientid!),
|
Routes.applicationCommands(env.dev.clientid!),
|
||||||
{ body: commands },
|
{ 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) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { REST, RESTGetAPIApplicationGuildCommandResult, RESTPutAPIApplicationCommandsJSONBody, Routes } from "discord.js"
|
import { REST, RESTPutAPIApplicationCommandsJSONBody, Routes } from "discord.js"
|
||||||
import fs from "fs"
|
import fs from "fs"
|
||||||
import env from "../src/utils/Env"
|
import env from "../src/utils/Env"
|
||||||
import { Command } from "../src/interfaces"
|
import { Command } from "../src/interfaces"
|
||||||
@@ -25,12 +25,13 @@ for (const file of contentMenuCommands) {
|
|||||||
try {
|
try {
|
||||||
console.log(`Started refreshing ${commands.length} application (/) commands.`)
|
console.log(`Started refreshing ${commands.length} application (/) commands.`)
|
||||||
|
|
||||||
const data = await rest.put(
|
await rest.put(
|
||||||
Routes.applicationGuildCommands(env.dev.devid!, env.dev.guildid!),
|
Routes.applicationGuildCommands(env.dev.devid!, env.dev.guildid!),
|
||||||
{ body: commands },
|
{ body: commands },
|
||||||
) as RESTGetAPIApplicationGuildCommandResult[]
|
).then(() => {
|
||||||
|
console.log(`Successfully reloaded ${commands.length} application (/) commands.`)
|
||||||
console.log(`Successfully reloaded ${data.length} application (/) commands.`)
|
process.exit(0)
|
||||||
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user