From 0538b79d7c6e04059d5a9c8544288e9a9bc103d0 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Thu, 1 Apr 2021 12:38:55 -0500 Subject: [PATCH] Message what roles are added for what user --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index ef7f6a2..e6ec4ea 100644 --- a/index.js +++ b/index.js @@ -44,12 +44,13 @@ async function addRoles(user, message) { if (client.users.cache.find(u => u.tag === user['What is your discord tag? (Ex: foodboi#9161)'])) { if (!message.guild.members.cache.get(client.users.cache.find(u => u.tag === user['What is your discord tag? (Ex: foodboi#9161)']).id).roles.cache.has(compRole.id)) { message.guild.members.cache.get(client.users.cache.find(u => u.tag === user['What is your discord tag? (Ex: foodboi#9161)']).id).roles.add(compRole).catch(console.error); + message.channel.send(`Adding "Competitor" role for: \`${user['What is your discord tag? (Ex: foodboi#9161)']}\``).catch(console.error); } if (user['Are you playing in the Novice or Advanced division?'] === "Novice") { if (message.guild.members.cache.get(message.author.id).hasPermission("ADMINISTRATOR")) { if (!message.guild.members.cache.get(client.users.cache.find(u => u.tag === user['What is your discord tag? (Ex: foodboi#9161)']).id).roles.cache.has(noviceRole.id)) { message.guild.members.cache.get(client.users.cache.find(u => u.tag === user['What is your discord tag? (Ex: foodboi#9161)']).id).roles.add(noviceRole).catch(console.error); - + message.channel.send(`Adding "Novice" role for: \`${user['What is your discord tag? (Ex: foodboi#9161)']}\``).catch(console.error); } } } @@ -58,6 +59,7 @@ async function addRoles(user, message) { if (message.guild.members.cache.get(message.author.id).hasPermission("ADMINISTRATOR")) { if (!message.guild.members.cache.get(client.users.cache.find(u => u.tag === user['What is your discord tag? (Ex: foodboi#9161)']).id).roles.cache.has(advancedRole.id)) { message.guild.members.cache.get(client.users.cache.find(u => u.tag === user['What is your discord tag? (Ex: foodboi#9161)']).id).roles.add(advancedRole).catch(console.error); + message.channel.send(`Adding "Advanced" role for: \`${user['What is your discord tag? (Ex: foodboi#9161)']}\``).catch(console.error); } } }