Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

126
Views
node.js discord bot wont ready

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);
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!