From c3fd22f02f96091c0395b0654f8044163c070826 Mon Sep 17 00:00:00 2001 From: Supositware Date: Sun, 7 Jul 2024 00:55:15 +0200 Subject: [PATCH] Fix for windows --- scripts/deploy-commands.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/deploy-commands.js b/scripts/deploy-commands.js index 57f9d8c..e01d8b6 100644 --- a/scripts/deploy-commands.js +++ b/scripts/deploy-commands.js @@ -2,7 +2,7 @@ import { REST } from '@discordjs/rest'; import { Routes } from 'discord-api-types/v9'; import fs from 'node:fs'; import path from 'node:path'; -import { fileURLToPath } from 'node:url'; +import { fileURLToPath, pathToFileURL } from 'node:url'; import dotenv from 'dotenv'; dotenv.config(); const { clientId, guildId, token } = process.env; @@ -17,7 +17,7 @@ for (let i = 0; i < categoryPath.length; i++) { const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js')); for (const file of commandFiles) { const filePath = path.join(commandsPath, file); - const command = await import(filePath); + const command = await import(pathToFileURL(filePath)); if (command.default.integration_types) { Object.assign(command.default.data, { integration_types: command.default.integration_types });