Updated dependencies and dev script

This commit is contained in:
2024-01-12 18:49:55 +01:00
parent 323a6dfea5
commit ce2bc43cf6
4 changed files with 125 additions and 118 deletions

View File

@@ -1,6 +1,7 @@
import { Command } from "../interfaces"
import chalk from "chalk"
import env from "./Env"
import color from "./functions/colors"
// import color from "./functions/colors"
import {
REST,
RESTGetAPIApplicationGuildCommandResult,
@@ -10,6 +11,9 @@ import {
import fs = require("fs")
type FileType = "js" | "ts"
const oldColor = chalk.hex("#f38ba8")
const newColor = chalk.hex("#b4befe")
export default async function autoDeployCommands(fileType: FileType) {
const commands = []
let commandFiles: string[] = []
@@ -86,17 +90,21 @@ export default async function autoDeployCommands(fileType: FileType) {
JSON.stringify(sortedCurrentCommandsInfo)
) {
console.log(
color.colorize("Commands are the same, skipping deploy.", "green"),
// color.colorize("Commands are the same, skipping deploy.", "green"),
newColor("Commands are the same, skipping deploy."),
)
console.log(color.colorize(newCmds, "green"))
// console.log(color.colorize(newCmds, "green"))
console.log(newColor(newCmds))
return
}
try {
console.log(
color.colorize("Commands are different, starting deploy.", "red"),
// color.colorize("Commands are different, starting deploy.", "red"),
oldColor("Commands are different, starting deploy."),
)
console.log(color.colorize(currentCmds, "red"))
// console.log(color.colorize(currentCmds, "red"))
console.log(oldColor(currentCmds))
console.log(
`Started refreshing ${commands.length} application (/) commands.`,
)
@@ -106,8 +114,10 @@ export default async function autoDeployCommands(fileType: FileType) {
{ body: commands },
)) as RESTPutAPIApplicationGuildCommandsJSONBody[]
console.log(color.colorize("New commands deployed.", "green"))
console.log(color.colorize(newCmds, "green"))
// console.log(color.colorize("New commands deployed.", "green"))
// console.log(color.colorize(newCmds, "green"))
console.log(newColor("New commands deployed."))
console.log(newColor(newCmds))
console.log(
`Successfully reloaded ${data.length} application (/) commands.`,
)

View File

@@ -26,8 +26,6 @@ const colors = {
bgWhite: "\x1b[47m",
}
function colorize(text: string, color: keyof typeof colors) {
export default function colorize(text: string, color: keyof typeof colors) {
return colors[color] + text + colors.reset
}
export default { colorize }
}