const { Client, GatewayIntentBits, EmbedBuilder, PermissionsBitField, Permissions, MessageManager, Embed, Collection } = require(`discord.js`); const fs = require('fs'); const { Partials } = require('discord.js'); const { ActivityType } = require('discord-api-types/v9'); const client = new Client({ intents: [ GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMembers, GatewayIntentBits.GuildPresences, GatewayIntentBits.GuildIntegrations, GatewayIntentBits.GuildWebhooks, GatewayIntentBits.GuildMessageReactions, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildEmojisAndStickers, GatewayIntentBits.DirectMessages, GatewayIntentBits.DirectMessageTyping, GatewayIntentBits.GuildModeration, GatewayIntentBits.GuildVoiceStates, GatewayIntentBits.GuildWebhooks, GatewayIntentBits.AutoModerationConfiguration, GatewayIntentBits.GuildScheduledEvents, GatewayIntentBits.GuildMessageTyping, GatewayIntentBits.AutoModerationExecution, ], partials: [ Partials.GuildMember, Partials.Channel, Partials.GuildScheduledEvent, Partials.Message, Partials.Reaction, Partials.ThreadMember, Partials.User ] }); client.commands = new Collection(); require('dotenv').config(); const functions = fs.readdirSync("./src/functions").filter(file => file.endsWith(".js")); const eventFiles = fs.readdirSync("./src/events").filter(file => file.endsWith(".js")); const commandFolders = fs.readdirSync("./src/commands"); (async () => { for (file of functions) { require(`./functions/${file}`)(client); } client.handleEvents(eventFiles, "./src/events"); client.handleCommands(commandFolders, "./src/commands"); client.login(process.env.token) })(); client.commands = new Collection(); client.on('ready', (c) => { console.log(`✅ ${c.user.tag} is online.`); client.user.setActivity({ name: '/help', type: ActivityType.Watching, }); }); client.login(process.env.TOKEN);