2024-05-23 09:22:31 +00:00
|
|
|
const { Events } = require('discord.js');
|
2024-06-15 16:52:42 +00:00
|
|
|
const fs = require('fs');
|
2024-05-23 09:22:31 +00:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
name: Events.GuildCreate,
|
|
|
|
once: false,
|
|
|
|
execute(guild) {
|
|
|
|
console.log(`Joined guild ${guild.name}`);
|
2024-06-15 16:52:42 +00:00
|
|
|
const guildPath = `./guilds-${new Date().toISOString().split('T')[0]}.txt`;
|
|
|
|
//save name - id - time of joining
|
|
|
|
fs.appendFileSync(guildPath, `JOIN: \`${guild.name}\` - ${guild.id} - ${new Date().toLocaleString()}\n`);
|
2024-05-23 09:22:31 +00:00
|
|
|
}
|
|
|
|
};
|