be sure that we fetching directories
All checks were successful
Lint and Format Check / lint-and-format (pull_request) Successful in 27s

This commit is contained in:
Mylloon 2024-09-18 18:10:31 +02:00
parent 504961d16e
commit 0571b6cb85
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
3 changed files with 11 additions and 11 deletions

View file

@ -1,5 +1,5 @@
import { readdir } from "fs/promises";
import { removeExtension, splitFilenameExtensions } from "../utils/misc";
import { removeExtension } from "../utils/misc";
import {
ChatInputCommandInteraction,
Client,
@ -10,9 +10,9 @@ import { getLocale } from "../utils/locales";
export default async (client: Client) => {
// Dossier des buttons
const buttons_categories = (await readdir(__dirname)).filter(
(element) => splitFilenameExtensions(element)?.ext === undefined,
);
const buttons_categories = (await readdir(__dirname, { withFileTypes: true }))
.filter((element) => element.isDirectory())
.map((element) => element.name);
await Promise.all(
// For each categorie

View file

@ -2,15 +2,15 @@ import { REST } from "@discordjs/rest";
import { Routes } from "discord-api-types/v9";
import { Client } from "discord.js";
import { readdir } from "fs/promises";
import { removeExtension, splitFilenameExtensions } from "../utils/misc";
import { removeExtension } from "../utils/misc";
/** Load all the commands */
export default async (client: Client) => {
const rest = new REST({ version: "10" }).setToken(client.token!);
const command_categories = (await readdir(__dirname)).filter(
(element) => splitFilenameExtensions(element)?.ext === undefined,
);
const command_categories = (await readdir(__dirname, { withFileTypes: true }))
.filter((element) => element.isDirectory())
.map((element) => element.name);
const commands = (
await Promise.all(

View file

@ -5,9 +5,9 @@ import { splitFilenameExtensions } from "../utils/misc";
/** Load all the events */
export default async (client: Client, isDev: boolean) => {
const events_categories = (await readdir(__dirname)).filter(
(element) => splitFilenameExtensions(element)?.ext === undefined,
);
const events_categories = (await readdir(__dirname, { withFileTypes: true }))
.filter((element) => element.isDirectory())
.map((element) => element.name);
const player = useMainPlayer();