Updated lint scripts
This commit is contained in:
@@ -18,8 +18,8 @@
|
|||||||
"dev:js": "nodemon --config nodemon-js.json dist/index.js",
|
"dev:js": "nodemon --config nodemon-js.json dist/index.js",
|
||||||
"dev:build": "cross-env NODE_PATH=src/ \"ts-node scripts/dev-deploy.ts\"",
|
"dev:build": "cross-env NODE_PATH=src/ \"ts-node scripts/dev-deploy.ts\"",
|
||||||
"dev:delete": "ts-node scripts/delete-commands.ts",
|
"dev:delete": "ts-node scripts/delete-commands.ts",
|
||||||
"lint": "eslint src",
|
"lint": "eslint",
|
||||||
"lint:fix": "eslint --fix src",
|
"lint:fix": "eslint --fix",
|
||||||
"prod:build": "cross-env NODE_PATH=src/ \"ts-node scripts/deploy-commands.ts\""
|
"prod:build": "cross-env NODE_PATH=src/ \"ts-node scripts/deploy-commands.ts\""
|
||||||
},
|
},
|
||||||
"author": "Taken",
|
"author": "Taken",
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ 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/interfaces"
|
||||||
import env from "../src/utils/Env"
|
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 commands: RESTPutAPIApplicationCommandsJSONBody = []
|
||||||
@@ -19,13 +20,16 @@ for (const file of contentMenuCommands) {
|
|||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
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(
|
await rest.put(
|
||||||
Routes.applicationCommands(env.dev.clientid!),
|
Routes.applicationCommands(env.dev.clientid!),
|
||||||
{ body: commands },
|
{ body: commands },
|
||||||
).then(() => {
|
).then(() => {
|
||||||
console.log(`Successfully reloaded ${commands.length} application (/) commands.`)
|
console.log(color(`Successfully reloaded ${commands.length} application (/) commands.`, "green"))
|
||||||
process.exit(0)
|
process.exit(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user