Updated lint scripts

This commit is contained in:
2024-08-20 22:52:00 +02:00
parent b456ab75f7
commit 7f33956dfb
2 changed files with 8 additions and 4 deletions

View File

@@ -18,8 +18,8 @@
"dev:js": "nodemon --config nodemon-js.json dist/index.js",
"dev:build": "cross-env NODE_PATH=src/ \"ts-node scripts/dev-deploy.ts\"",
"dev:delete": "ts-node scripts/delete-commands.ts",
"lint": "eslint src",
"lint:fix": "eslint --fix src",
"lint": "eslint",
"lint:fix": "eslint --fix",
"prod:build": "cross-env NODE_PATH=src/ \"ts-node scripts/deploy-commands.ts\""
},
"author": "Taken",

View File

@@ -2,6 +2,7 @@ import { REST, RESTPutAPIApplicationCommandsJSONBody, Routes } from "discord.js"
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 commands: RESTPutAPIApplicationCommandsJSONBody = []
@@ -19,13 +20,16 @@ for (const file of contentMenuCommands) {
(async () => {
try {
console.log(`Started refreshing ${commands.length} application (/) commands.`)
console.log(color(`Started refreshing ${commands.length} application (/) commands.`, "green"))
const commandsString = commands.map(command => " " + command.name)
console.log(color(commandsString.join("\n"), "lavender"))
await rest.put(
Routes.applicationCommands(env.dev.clientid!),
{ body: commands },
).then(() => {
console.log(`Successfully reloaded ${commands.length} application (/) commands.`)
console.log(color(`Successfully reloaded ${commands.length} application (/) commands.`, "green"))
process.exit(0)
})