Updated autodeploy script

This commit is contained in:
2024-01-28 12:09:27 +01:00
parent 9a9d2a76dd
commit a3625e2e3f

View File

@@ -95,12 +95,13 @@ export default async function autoDeployCommands(fileType: FileType, client: Ext
} }
for (const cmd of commandData) { for (const cmd of commandData) {
const currentCommand = currentCommandsData.find(c => c.name === cmd.name)! if (!currentCommandsData.find(c => c.name === cmd.name)) continue
const newCmd = commands.find(c => c.name === cmd.name)!
const currentCommandID = currentCommands.find(c => c.name === cmd.name)!.id
if (JSON.stringify(cmd) !== JSON.stringify(currentCommand)) { const currentCommand = currentCommands.find(c => c.name === cmd.name)!
await guildclient.commands.edit(currentCommandID, newCmd) const currentCommandData = currentCommandsData.find(c => c.name === cmd.name)!
if (JSON.stringify(cmd) !== JSON.stringify(currentCommandData)) {
await guildclient.commands.edit(currentCommand.id, cmd)
console.log(color(" " + cmd.name + " was updated.", "lavender")) console.log(color(" " + cmd.name + " was updated.", "lavender"))
} }
} }