From 7f3acbb8f3229b6127a389503161c17f26522c88 Mon Sep 17 00:00:00 2001 From: Jack Date: Fri, 24 Jul 2020 15:01:53 +0100 Subject: [PATCH] not giving role if not verified --- functions/index.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/functions/index.js b/functions/index.js index 8afcd1e4b..c85ed1e45 100644 --- a/functions/index.js +++ b/functions/index.js @@ -569,10 +569,15 @@ exports.testCompleted = functions.https.onCall(async (request, response) => { userdata.discordId !== null && userdata.discordId !== undefined ) { - console.log( - `sending command to the bot to update the role for user ${request.uid} with wpm ${obj.wpm}` - ); - updateDiscordRole(userdata.discordId, Math.round(obj.wpm)); + if (verified !== false) { + console.log( + `sending command to the bot to update the role for user ${request.uid} with wpm ${obj.wpm}` + ); + updateDiscordRole( + userdata.discordId, + Math.round(obj.wpm) + ); + } } returnobj.resultCode = 2; } else {