chore: merge dev to main #172

Merged
Anri merged 11 commits from dev into main 2024-09-18 18:25:04 +02:00
3 changed files with 11 additions and 11 deletions
Showing only changes of commit 0571b6cb85 - Show all commits

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();