Welcome message not sending

HELP SIR
16 Replies
d.js toolkit
d.js toolkit2mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
Mussaplays.
Mussaplays.2mo ago
module.exports = {
name: 'GuildMemberAdd',
async execute(member) {
console.log(`New member joined: ${member.user.tag}`);

const welcomeChannelId = '1238747448046780496';
const welcomeChannel = member.guild.channels.cache.get(welcomeChannelId);

try {
await welcomeChannel.send(`Welcome to the server, ${member.user}!`);
console.log(`Welcome message sent to ${member.user.tag}`);
} catch (error) {
console.error(`${error}`);
}
}
}
module.exports = {
name: 'GuildMemberAdd',
async execute(member) {
console.log(`New member joined: ${member.user.tag}`);

const welcomeChannelId = '1238747448046780496';
const welcomeChannel = member.guild.channels.cache.get(welcomeChannelId);

try {
await welcomeChannel.send(`Welcome to the server, ${member.user}!`);
console.log(`Welcome message sent to ${member.user.tag}`);
} catch (error) {
console.error(`${error}`);
}
}
}
My welcome code
const { Client, GatewayIntentBits, EmbedBuilder, PermissionsBitField, Permissions, MessageManager, Embed, Collection } = require(`discord.js`);
const fs = require('fs');
const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent] });

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)
})();





const { Client, GatewayIntentBits, EmbedBuilder, PermissionsBitField, Permissions, MessageManager, Embed, Collection } = require(`discord.js`);
const fs = require('fs');
const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent] });

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)
})();





my index.js
Mussaplays.
Mussaplays.2mo ago
This is where i add file
No description
TÆMBØ
TÆMBØ2mo ago
1: You're missing the GatewayIntentBits.GuildMembers intent 2: The event name is guildMemberAdd - lowercase G
Mussaplays.
Mussaplays.2mo ago
it still did not work after i did everthing you tell
TÆMBØ
TÆMBØ2mo ago
Can you share your updated code?
Mussaplays.
Mussaplays.2mo ago
const { Client, GatewayIntentBits, EmbedBuilder, PermissionsBitField, Permissions, MessageManager, Embed, Collection } = require(`discord.js`);
const fs = require('fs');
const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMembers ] });

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)
})();





const { Client, GatewayIntentBits, EmbedBuilder, PermissionsBitField, Permissions, MessageManager, Embed, Collection } = require(`discord.js`);
const fs = require('fs');
const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMembers ] });

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)
})();





index
module.exports = {
name: 'GuildMemberAdd',
async execute(member) {
console.log(`New member joined: ${member.user.tag}`);

const welcomeChannelId = '1246277461608763392';
const welcomeChannel = member.guild.channels.cache.get(welcomeChannelId);

try {
await welcomeChannel.send(`Welcome to the server, ${member.user}!`);
console.log(`Welcome message sent to ${member.user.tag}`);
} catch (error) {
console.error(`${error}`);
}
}
}
module.exports = {
name: 'GuildMemberAdd',
async execute(member) {
console.log(`New member joined: ${member.user.tag}`);

const welcomeChannelId = '1246277461608763392';
const welcomeChannel = member.guild.channels.cache.get(welcomeChannelId);

try {
await welcomeChannel.send(`Welcome to the server, ${member.user}!`);
console.log(`Welcome message sent to ${member.user.tag}`);
} catch (error) {
console.error(`${error}`);
}
}
}
welcome
Squid
Squid2mo ago
The event's name must be 'guildMemberAdd' with a lowercase "g". Events.GuildMemberAdd returns this same string, but the casing is important
Mussaplays.
Mussaplays.2mo ago
guildMemberAdd
Squid
Squid2mo ago
That's right
Mussaplays.
Mussaplays.2mo ago
No description
Squid
Squid2mo ago
No description
Mussaplays.
Mussaplays.2mo ago
right?
Mussaplays.
Mussaplays.2mo ago
No description
Squid
Squid2mo ago
yes
Mussaplays.
Mussaplays.2mo ago
lets try Thx tysm