-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[New] Added guildMemberAdd which triggers when a new user joins a server
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
module.exports = { | ||
name: "guildMemberAdd", | ||
async execute(guild) { | ||
const welcomeEmbed = { | ||
color: "#9dcc37", | ||
title: `New Member joined!`, | ||
thumbnail: { | ||
url: `${guild.user.avatarURL()}`, | ||
}, | ||
fields: [ | ||
{ | ||
name: ":man_detective: Member", | ||
value: `${guild.toString()}`, | ||
}, | ||
{ | ||
name: ":clock2: Joined Server", | ||
value: `${guild.joinedAt.toDateString()}`, | ||
}, | ||
{ | ||
name: ":chart_with_downwards_trend: Member Number", | ||
value: `#${guild.guild.memberCount}`, | ||
}, | ||
{ | ||
name: ":calendar_spiral: Joined Discord", | ||
value: `${guild.user.createdAt.toDateString()}`, | ||
}, | ||
], | ||
}; | ||
|
||
if (guild.guild.systemChannel) { | ||
guild.guild.systemChannel.send({ | ||
content: `Hey ${guild.toString()}, Welcome to ${ | ||
guild.guild.name | ||
}! :partying_face:`, | ||
embeds: [welcomeEmbed], | ||
}); | ||
} else { | ||
return; | ||
} | ||
}, | ||
}; |