mirror of
https://github.com/Team-Neptune/Korral-JS.git
synced 2024-11-23 12:39:40 +00:00
Adding member emu and more member join and leave
This commit is contained in:
parent
463f16b184
commit
9a19a290d5
23
Index.js
23
Index.js
@ -137,6 +137,29 @@ client.on('guildMemberAdd', member => {
|
||||
}
|
||||
);
|
||||
|
||||
//Member leave
|
||||
client.on('guildMemberRemove', member => {
|
||||
var today = new Date();
|
||||
var date = today.getMonth()+1+'-'+(today.getDate())+'-'+today.getFullYear();
|
||||
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
|
||||
global.dateTime = date+' '+time;
|
||||
const channel = member.guild.channels.cache.find(ch => ch.id === `${ModLog}`);
|
||||
const guild = member.guild
|
||||
if (!channel) return;
|
||||
const MemberLeaveEmbed = new Discord.MessageEmbed()
|
||||
.setColor('#ff0000')
|
||||
.setTitle('Member Leave')
|
||||
.addFields(
|
||||
{ name: 'Username', value: member.user.tag, inline: false },
|
||||
{ name: 'Member ID', value: member.user.id, inline: false },
|
||||
{ name: 'Account creation date', value: member.user.createdAt, inline: false },
|
||||
{ name: 'Server leave date', value: dateTime, inline: false },
|
||||
{ name: 'Server member count', value: `${guild.memberCount}`, inline: false },
|
||||
)
|
||||
.setTimestamp()
|
||||
channel.send(MemberLeaveEmbed)
|
||||
});
|
||||
|
||||
//Log deleted messages
|
||||
client.on('messageDelete', async message => {
|
||||
const fetchedLogs = await message.guild.fetchAuditLogs({
|
||||
|
12
commands/emujoin.js
Normal file
12
commands/emujoin.js
Normal file
@ -0,0 +1,12 @@
|
||||
module.exports = {
|
||||
name: 'emujoin',
|
||||
aliases: ['joinemu'],
|
||||
description: 'This is for testing purposes only. Remove from release.',
|
||||
usage: 'N/A',
|
||||
cooldown: 0,
|
||||
botmanager:true,
|
||||
hidden:true,
|
||||
execute(message, args) {
|
||||
global.client = new Discord.Client()
|
||||
client.emit("guildMemberAdd", message.member)
|
||||
}}
|
12
commands/emuleave.js
Normal file
12
commands/emuleave.js
Normal file
@ -0,0 +1,12 @@
|
||||
module.exports = {
|
||||
name: 'emuleave',
|
||||
aliases: ['leaveemu'],
|
||||
description: 'This is for testing purposes only. Remove from release.',
|
||||
usage: '',
|
||||
cooldown: 0,
|
||||
botmanager:true,
|
||||
hidden:true,
|
||||
execute(message, args) {
|
||||
global.client = new Discord.Client()
|
||||
client.emit("guildMemberRemove", message.member)
|
||||
}}
|
Loading…
Reference in New Issue
Block a user