From 4fe4d93fb00b0eb9dc9099505394a448389ae668 Mon Sep 17 00:00:00 2001 From: tresabhi Date: Wed, 26 Apr 2023 23:43:13 +0000 Subject: [PATCH] fix: only react to people joining skilled clan --- src/behaviors/guildMemberAdd.ts | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/behaviors/guildMemberAdd.ts b/src/behaviors/guildMemberAdd.ts index 04c4d07c3..92f2833ee 100644 --- a/src/behaviors/guildMemberAdd.ts +++ b/src/behaviors/guildMemberAdd.ts @@ -3,19 +3,21 @@ import discord from '../../discord.json' assert { type: 'json' }; import { SKILLED_COLOR } from '../constants/colors.js'; export default async function (member: GuildMember) { - console.log(`${member.user.tag} joined`); + if (member.guild.id === discord.guild_id) { + await ( + member.guild.channels.cache.get(discord.verify_channel) as TextChannel + ).send({ + content: member.toString(), + embeds: [ + new EmbedBuilder() + .setColor(SKILLED_COLOR) + .setTitle(`Welcome ${member.user.username}`) + .setDescription( + `Welcome to the Skilled server, **${member.user.username}**! To continue, please use the \`/verify\` command.\n\nExample: \`/verify Europe Sabina244\``, + ), + ], + }); - await ( - member.guild.channels.cache.get(discord.verify_channel) as TextChannel - ).send({ - content: member.toString(), - embeds: [ - new EmbedBuilder() - .setColor(SKILLED_COLOR) - .setTitle(`Welcome ${member.user.username}`) - .setDescription( - `Welcome to the Skilled server, **${member.user.username}**! To continue, please use the \`/verify\` command.\n\nExample: \`/verify Europe Sabina244\``, - ), - ], - }); + console.log(`${member.user.tag} joined`); + } }