oh
This commit is contained in:
parent
5f5b5ca547
commit
071e41136a
21
index.js
21
index.js
|
@ -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
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue