add welcome msg to new user

This commit is contained in:
Nico Jensen 2022-02-01 02:56:04 +01:00
parent fc6ca20944
commit 735494ee6b
2 changed files with 26 additions and 1 deletions

View File

@ -0,0 +1,20 @@
const {GuildMember, MessageEmbed} = require('discord.js');
module.exports = {
name: "guildMemberAdd",
/**
*
* @param {GuildMember} member
*/
execute(member) {
member.guild.channels.cache.get("814661833642344520").send({
embeds: [
new MessageEmbed()
.setTitle("Moin")
.setDescription(`Moin ${member.toString()}! Wilkommen und viel Spaß.`)
.setThumbnail(member.user.displayAvatarURL())
.setColor("BLURPLE")
]
})
}
}

View File

@ -7,12 +7,17 @@ const client = new Client({intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_V
client.commands = new Collection()
const CommandFiles = fs.readdirSync("./src/commands").filter(file => file.endsWith(".js"))
CommandFiles.forEach(CommandFile => {
const command = require(`./commands/${CommandFile}`)
client.commands.set(command.data.name, command)
})
const EventFiles = fs.readdirSync("./src/events").filter(file => file.endsWith(".js"))
EventFiles.forEach(EventFile => {
const event = require(`./events/${EventFile}`)
client.on(event.name, (...args) => event.execute(...args))
})
client.once('ready', () => {
console.log(`Ready! Logged in as ${client.user.tag}! I'm on ${client.guilds.cache.size} guild(s)!`);
client.user.setActivity({