Updated types

This commit is contained in:
2024-08-26 22:29:37 +02:00
parent 15cce327e3
commit 9050eff5a5
8 changed files with 36 additions and 36 deletions

View File

@@ -1,13 +1,13 @@
import { REST, Routes } from "discord.js"
import env from "../src/utils/Env"
const rest = new REST({ version: "10" }).setToken(env.dev.devtoken!)
const rest = new REST({ version: "10" }).setToken(env.dev.devtoken)
async function deleteCommands() {
try {
console.log("Started deleting application (/) commands.")
await rest.put(
Routes.applicationGuildCommands(env.dev.devid!, env.dev.guildid!),
Routes.applicationGuildCommands(env.dev.devid, env.dev.guildid),
{ body: [] },
)
console.log("Successfully deleted application (/) commands.")
@@ -15,4 +15,4 @@ async function deleteCommands() {
console.error(error)
}
}
deleteCommands()
deleteCommands()

View File

@@ -3,7 +3,7 @@ import fs from "node:fs"
import { ICommand } from "../src/interfaces"
import env from "../src/utils/Env"
import color from "../src/utils/functions/colors"
const rest = new REST({ version: "10" }).setToken(env.prod.token!)
const rest = new REST({ version: "10" }).setToken(env.prod.token)
const commands: RESTPutAPIApplicationCommandsJSONBody = []
const commandFiles = fs.readdirSync("./src/commands").filter(file => file.endsWith(".ts"))
@@ -26,7 +26,7 @@ for (const file of contentMenuCommands) {
console.log(color(commandsString.join("\n"), "lavender"))
await rest.put(
Routes.applicationCommands(env.dev.clientid!),
Routes.applicationCommands(env.dev.clientid),
{ body: commands },
).then(() => {
console.log(color(`Successfully reloaded ${commands.length} application (/) commands.`, "green"))
@@ -36,4 +36,4 @@ for (const file of contentMenuCommands) {
} catch (error) {
console.error(error)
}
})()
})()

View File

@@ -2,7 +2,7 @@ import { REST, RESTPutAPIApplicationCommandsJSONBody, Routes } from "discord.js"
import fs from "fs"
import env from "../src/utils/Env"
import { ICommand } from "../src/interfaces"
const rest = new REST({ version: "10" }).setToken(env.dev.devtoken!)
const rest = new REST({ version: "10" }).setToken(env.dev.devtoken)
const commands: RESTPutAPIApplicationCommandsJSONBody = []
const commandFiles = fs.readdirSync("./src/commands/").filter(file => file.endsWith(".ts"))
@@ -26,7 +26,7 @@ for (const file of contentMenuCommands) {
console.log(`Started refreshing ${commands.length} application (/) commands.`)
await rest.put(
Routes.applicationGuildCommands(env.dev.devid!, env.dev.guildid!),
Routes.applicationGuildCommands(env.dev.devid, env.dev.guildid),
{ body: commands },
).then(() => {
console.log(`Successfully reloaded ${commands.length} application (/) commands.`)
@@ -35,4 +35,4 @@ for (const file of contentMenuCommands) {
} catch (error) {
console.error(error)
}
})()
})()