Updated scripts
This commit is contained in:
@@ -1,13 +1,13 @@
|
|||||||
import { REST, Routes } from "discord.js"
|
import { REST, Routes } from "discord.js"
|
||||||
import env from "../src/utils/Env"
|
import env from "../src/utils/Env"
|
||||||
import { log } from "../src/utils/Logger.js"
|
import { log } from "../src/utils/Logger"
|
||||||
|
|
||||||
const rest = new REST({ version: "10" }).setToken(env.dev.DEVTOKEN)
|
const rest = new REST({ version: "10" }).setToken(env.dev.DEVTOKEN)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
log("Started deleting application (/) commands.", "info")
|
log("Started deleting application (/) commands.", "info")
|
||||||
await rest.put(
|
await rest.put(
|
||||||
Routes.applicationGuildCommands(env.dev.devid, env.dev.guildid),
|
Routes.applicationGuildCommands(env.dev.DEVID, env.dev.GUILDID),
|
||||||
{ body: [] }
|
{ body: [] }
|
||||||
)
|
)
|
||||||
log("Successfully deleted application (/) commands.", "info")
|
log("Successfully deleted application (/) commands.", "info")
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { REST, RESTPutAPIApplicationCommandsJSONBody, Routes } from "discord.js"
|
import { REST, RESTPutAPIApplicationCommandsJSONBody, Routes } from "discord.js"
|
||||||
import fs from "node:fs"
|
import fs from "node:fs"
|
||||||
import { ICommand } from "../src/interfaces"
|
import { ICommand } from "../src/typings"
|
||||||
import env from "../src/utils/Env"
|
import env from "../src/utils/Env"
|
||||||
import { log } from "../src/utils/Logger.js"
|
import { log } from "../src/utils/Logger"
|
||||||
const rest = new REST({ version: "10" }).setToken(env.prod.TOKEN)
|
const rest = new REST({ version: "10" }).setToken(env.prod.TOKEN)
|
||||||
|
|
||||||
const commands: RESTPutAPIApplicationCommandsJSONBody = []
|
const commands: RESTPutAPIApplicationCommandsJSONBody = []
|
||||||
@@ -25,7 +25,7 @@ try {
|
|||||||
log(commandsString.join("\n"), "info", { type: "preset", color: "lavender" })
|
log(commandsString.join("\n"), "info", { type: "preset", color: "lavender" })
|
||||||
|
|
||||||
await rest.put(
|
await rest.put(
|
||||||
Routes.applicationCommands(env.dev.clientid),
|
Routes.applicationCommands(env.dev.CLIENTID),
|
||||||
{ body: commands }
|
{ body: commands }
|
||||||
).then(() => {
|
).then(() => {
|
||||||
log(`Successfully reloaded ${commands.length} application (/) commands.`, "info", { type: "preset", color: "green" })
|
log(`Successfully reloaded ${commands.length} application (/) commands.`, "info", { type: "preset", color: "green" })
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { REST, RESTPutAPIApplicationCommandsJSONBody, Routes } from "discord.js"
|
import { REST, RESTPutAPIApplicationCommandsJSONBody, Routes } from "discord.js"
|
||||||
import fs from "fs"
|
import fs from "fs"
|
||||||
import { ICommand } from "../src/interfaces"
|
import { ICommand } from "../src/typings"
|
||||||
import env from "../src/utils/Env"
|
import env from "../src/utils/Env"
|
||||||
import { log } from "../src/utils/Logger.js"
|
import { log } from "../src/utils/Logger"
|
||||||
const rest = new REST({ version: "10" }).setToken(env.dev.DEVTOKEN)
|
const rest = new REST({ version: "10" }).setToken(env.dev.DEVTOKEN)
|
||||||
|
|
||||||
const commands: RESTPutAPIApplicationCommandsJSONBody = []
|
const commands: RESTPutAPIApplicationCommandsJSONBody = []
|
||||||
@@ -26,7 +26,7 @@ try {
|
|||||||
log(`Started refreshing ${commands.length} application (/) commands.`, "info")
|
log(`Started refreshing ${commands.length} application (/) commands.`, "info")
|
||||||
|
|
||||||
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 }
|
||||||
).then(() => {
|
).then(() => {
|
||||||
log(`Successfully reloaded ${commands.length} application (/) commands.`, "info")
|
log(`Successfully reloaded ${commands.length} application (/) commands.`, "info")
|
||||||
|
|||||||
Reference in New Issue
Block a user