Added guildmemberadd
This commit is contained in:
parent
74337d2bfd
commit
a865f6252f
16
discord-bot/events/guildMemberAdd.js
Normal file
16
discord-bot/events/guildMemberAdd.js
Normal 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] });
|
||||
},
|
||||
};
|
@ -15,7 +15,7 @@ const log = {
|
||||
};
|
||||
|
||||
// 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);
|
||||
|
||||
require('./functions/player.js').registerEvents({ client, createEmbed });
|
||||
|
Loading…
Reference in New Issue
Block a user