Skip to content

Commit

Permalink
Welcome Members!
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerPottsDev committed Nov 8, 2021
1 parent aff16e7 commit d6d51c7
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
3 changes: 2 additions & 1 deletion bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ const { Client, Intents, Collection } = require("discord.js");
const client = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_MEMBERS
]
});

Expand Down
20 changes: 20 additions & 0 deletions events/guildMemberAdd.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const Discord = require('discord.js');

module.exports = {
name: "guildMemberAdd",
async execute(member) {
// member.guild.channels.cache.get("849283385808912384").send(`${member.user} has joined the server!`);
console.log(member.user);

const newMemberEmbed = new Discord.MessageEmbed()
.setColor("#d81e5b")
.setTitle("New Member!")
.setDescription(`${member.user} has joined the server! We hope you enjoy your stay!`)
.setThumbnail(member.user.displayAvatarURL())
.setTimestamp();

member.guild.channels.cache.get("849283385808912384").send({
embeds: [newMemberEmbed]
})
}
}
6 changes: 6 additions & 0 deletions events/guildMemberRemove.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
name: "guildMemberRemove",
async execute(member) {
member.guild.channels.cache.get("849283385808912384").send(`${member.user} has left the server!`);
}
}
1 change: 0 additions & 1 deletion events/interactionCreate.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module.exports = {
name: "interactionCreate",
once: true, // REMOVE IN NEXT TUTORIAL
async execute(interaction) {
if (!interaction.isCommand()) return;

Expand Down

0 comments on commit d6d51c7

Please sign in to comment.