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

View file

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

View file

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