From 3defb3783fbf45dcc2dad154c86095573c13e5f1 Mon Sep 17 00:00:00 2001 From: Techwizz-somboo Date: Tue, 5 Sep 2023 01:53:34 +0000 Subject: [PATCH] Fixed pinging users in welcome message --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 4c10c47..61e77cc 100644 --- a/index.js +++ b/index.js @@ -13,7 +13,6 @@ const modchat = process.env.MODCHAT; const botStatus = process.env.BOT_STATUS; // This shows as the bot's status in Discord const adminRole = process.env.ADMIN_ROLE; // So admins can use the !bot command const welcomeChannelId = process.env.WELCOME_CHANNEL; // Channel where welcome messages are sent -const welcomeMessage = process.env.WELCOME_MESSAGE; // Message displayed when new users join // The list file locations are initalized here const badWordsList = './lists/badwords.txt'; @@ -46,7 +45,8 @@ bot.on('ready', () => { bot.on('guildMemberAdd', (member) => { console.log(member) member.guild.channels.fetch(welcomeChannelId).then(channel => { - channel.send(welcomeMessage) + const welcomeMessage = process.env.WELCOME_MESSAGE.replace('<@${member.id}>', `<@${member.id}>`); + channel.send(welcomeMessage); }); });