I don't now why it don't works

code : require('dotenv').config();


const { Client, Collection, GatewayIntentBits } = require("discord.js");
const fs = require("fs");
const logs = require("discord-logs")


const { Guilds, GuildMembers, GuildMessages, MessageContent } = GatewayIntentBits;
const { User, Message, GuildMember } = MessageContent;

const client = new Client({
intents: [Guilds, GuildMembers, GuildMessages],
partials: [User, Message, GuildMember],
});
client.commands = new Collection();
client.commandArray = [];

logs(client, {
debug: true
});

const functionFolders = fs.readdirSync(./src/functions);
for (const folder of functionFolders) {
const functionFiles = fs
.readdirSync(./src/functions/${folder})
.filter(file => file.endsWith('.js'));
for (const file of functionFiles)
require(./functions/${folder}/${file})(client);
}

client.handleEvents();
client.handleCommands();
client.handleLogs();
client.login("censuredcode");
image.png
Was this page helpful?