I've recently gotten interested in discord bots so I started coding one however now about a day in everything stopped working kick, ban, clear everything I coded isn't working the discord bot won't ready theirs no response in the terminal once so even if I try to run it here's my code
const mySecret = process.env[`TOKEN`]
const Discord = require("discord.js");
const prefix = '!';
const fs = require('fs');
const client = new Discord.Client({ intents: ["GUILDS", "GUILD_MESSAGES", "GUILD_MEMBERS"], partials: ["MESSAGE", "CHANNEL", "REACTION"] });
client.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const command = require(`./commands/${file}`);
client.commands.set(command.name, command);
}
const welcome = require("./welcome");
client.on('ready', () => {
console.log("Our Discord bot is online");
welcome(client);
});
client.on('message', message => {
if (!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if (command === 'clear') {
client.commands.get('clear').execute(message, args);
} else if (command === 'kick') {
client.commands.get('kick').execute(message, args);
} else if (command === 'ban') {
client.commands.get('ban').execute(message, args);
} else if (command === 'mute') {
client.commands.get('mute').execute(message, args);
} else if (command === 'unmute') {
client.commands.get('unmute').execute(message, args);
}
});
client.on("message", msg => {
if (msg.content === "i love snick") {
msg.reply("Me too!");
}
})
client.login(process.env.TOKEN);