Added guildmemberadd

This commit is contained in:
xeovalyte 2022-12-22 18:29:38 +01:00
parent 74337d2bfd
commit a865f6252f
2 changed files with 17 additions and 1 deletions

View File

@ -0,0 +1,16 @@
const { Events, EmbedBuilder } = require('discord.js');
module.exports = {
name: Events.GuildMemberAdd,
async execute({ client, log }, member) {
log.Info(`${member.user.username} has joined`);
const newMemberEmbed = new EmbedBuilder()
.setTitle(`${member.user.username} has joined!`)
.setDescription(`Welcome ${member} to the **Polarcraft** Discord server!`)
.setThumbnail(member.user.avatarURL());
const channel = await client.channels.cache.get(process.env.LOG_CHANNEL_ID);
channel.send({ embeds: [newMemberEmbed] });
},
};

View File

@ -15,7 +15,7 @@ const log = {
}; };
// Register client and music events // Register client and music events
const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildVoiceStates] }); const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildVoiceStates, GatewayIntentBits.GuildMembers] });
client.player = new Player(client); client.player = new Player(client);
require('./functions/player.js').registerEvents({ client, createEmbed }); require('./functions/player.js').registerEvents({ client, createEmbed });