This commit is contained in:
Christopher Cookman 2024-05-09 22:36:56 -06:00
parent 5f5b5ca547
commit 071e41136a
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

View file

@ -1068,19 +1068,16 @@ discord.on("interactionCreate", async (interaction) => {
}); });
discord.on("guildMemberAdd", (member) => { discord.on("guildCreate", (guild) => {
console.log("test")
// If it wasnt the bot, ignore
if (member.user.id !== discord.user.id) return;
// Get the main 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 // 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 // Send a message to the log channel
channel.send({ channel.send({
embeds: [ embeds: [
{ {
description: `I joined \`${member.guild.name}\``, description: `I joined \`${guild.name}\``,
color: 0x00ff00 color: 0x00ff00
} }
] ]
@ -1088,18 +1085,16 @@ discord.on("guildMemberAdd", (member) => {
}) })
discord.on("guildMemberRemove", (member) => { discord.on("guildDelete", (guild) => {
// If it wasnt the bot, ignore
if (member.user.id !== discord.user.id) return;
// Get the main 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 // 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 // Send a message to the log channel
channel.send({ channel.send({
embeds: [ embeds: [
{ {
description: `I left \`${member.guild.name}\``, description: `I left \`${guild.name}\``,
color: 0xff0000 color: 0xff0000
} }
] ]