From 071e41136ad2721b4f9d81694c0262b8bcf33ba5 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Thu, 9 May 2024 22:36:56 -0600 Subject: [PATCH] oh --- index.js | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/index.js b/index.js index 1f6e147..d295196 100644 --- a/index.js +++ b/index.js @@ -1068,19 +1068,16 @@ discord.on("interactionCreate", async (interaction) => { }); -discord.on("guildMemberAdd", (member) => { - console.log("test") - // If it wasnt the bot, ignore - if (member.user.id !== discord.user.id) return; +discord.on("guildCreate", (guild) => { // Get the main guild - const guild = discord.guilds.cache.get(config.discord.mainGuild); + const myGuild = discord.guilds.cache.get(config.discord.mainGuild); // Get the log channel - const channel = guild.channels.cache.get(config.discord.logChannel); + const channel = myGuild.channels.cache.get(config.discord.logChannel); // Send a message to the log channel channel.send({ embeds: [ { - description: `I joined \`${member.guild.name}\``, + description: `I joined \`${guild.name}\``, color: 0x00ff00 } ] @@ -1088,18 +1085,16 @@ discord.on("guildMemberAdd", (member) => { }) -discord.on("guildMemberRemove", (member) => { - // If it wasnt the bot, ignore - if (member.user.id !== discord.user.id) return; +discord.on("guildDelete", (guild) => { // Get the main guild - const guild = discord.guilds.cache.get(config.discord.mainGuild); + const myGuild = discord.guilds.cache.get(config.discord.mainGuild); // Get the log channel - const channel = guild.channels.cache.get(config.discord.logChannel); + const channel = myGuild.channels.cache.get(config.discord.logChannel); // Send a message to the log channel channel.send({ embeds: [ { - description: `I left \`${member.guild.name}\``, + description: `I left \`${guild.name}\``, color: 0xff0000 } ]