forked from Supositware/Haha-Yes
Fix for windows
This commit is contained in:
parent
2afbca10ec
commit
c3fd22f02f
1 changed files with 2 additions and 2 deletions
|
@ -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 });
|
||||
|
|
Loading…
Reference in a new issue