feat: mise à jour du code
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const { Collection } = require("discord.js");
|
||||
const { config } = require("./configLoader");
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { Collection } = require('discord.js');
|
||||
const { config } = require('./configLoader');
|
||||
|
||||
function loadModals(client) {
|
||||
const interactionsPath = path.join(__dirname, "../interactions");
|
||||
const interactionsPath = path.join(__dirname, '../interactions');
|
||||
client.modals = new Collection();
|
||||
|
||||
const files = fs.readdirSync(interactionsPath).filter(f => f.toLowerCase().includes("modal") && f.endsWith(".js"));
|
||||
const files = fs
|
||||
.readdirSync(interactionsPath)
|
||||
.filter((f) => f.toLowerCase().includes('modal') && f.endsWith('.js'));
|
||||
|
||||
for (const file of files) {
|
||||
const modal = require(path.join(interactionsPath, file));
|
||||
@@ -21,4 +23,4 @@ function getModal(customId) {
|
||||
return config.TicketPanel?.Modals?.[customId] || null;
|
||||
}
|
||||
|
||||
module.exports = { loadModals, getModal };
|
||||
module.exports = { loadModals, getModal };
|
||||
|
||||
Reference in New Issue
Block a user