add welcome msg to new user
This commit is contained in:
parent
fc6ca20944
commit
735494ee6b
20
src/events/guildMemberAdd.js
Normal file
20
src/events/guildMemberAdd.js
Normal 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")
|
||||
]
|
||||
})
|
||||
}
|
||||
}
|
@ -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({
|
||||
|
Loading…
Reference in New Issue
Block a user