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

157
Views
Welcome message not working and gives no errors in console

I made a welcome message but it is not working and gives no errors in the console. All code looks fine to me but it's not working and I don't know why!

welcome.js file code:

module.exports = (client) => {
  const channelId = "906885175617683457";
  const rulesChannel = "874498102139166731";
  client.on("guildMemberAdd", (member) => {
    console.log(member);

    const message = `Welcome <@${
      member.id
    }> to our server! Be sure to check out our ${member.guild.channels.cache
      .get(rulesChannel)
      .toString()}`;

    const channel = member.guild.channels.cache.get(channelId);
    channel.send(message);
  });
};

And index.js file code:

const Discord = require('discord.js');
const client = new Discord.Client();
const welcome = require('./welcome');
client.on ("ready", () => {
   console.log("Our bot is online");
   welcome(client)
   
});
client.login(token);

What am I doing wrong?

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!