From 270d6ca91f026180f4c4a64e98a393964131ce08 Mon Sep 17 00:00:00 2001 From: smyalygames Date: Thu, 3 Nov 2022 21:35:18 +0000 Subject: [PATCH] feat(arabot): add fix for bad word API error --- src/listeners/verification/joinVC.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/listeners/verification/joinVC.ts b/src/listeners/verification/joinVC.ts index 4b1b224..a798bdf 100644 --- a/src/listeners/verification/joinVC.ts +++ b/src/listeners/verification/joinVC.ts @@ -111,7 +111,6 @@ class VerificationJoinVCListener extends Listener { await channel.setName('Verifier Meeting'); verifier = true; } else { - await channel.setName(`${member.displayName} - Verification`); await currentChannel.send(`Hiya ${member.user}, please be patient as a verifier has been called out to verify you.\n\n` + 'If you leave this voice channel, you will automatically be given the non-vegan role where you gain access to this server and if you\'d like to verify as a vegan again, you\'d have to contact a Mod, which could be done via ModMail.'); // Adds to the database that the user joined verification @@ -143,6 +142,7 @@ class VerificationJoinVCListener extends Listener { // TODO refactor this mess to circumvent // "Contains words not allowed for servers in Server Discovery." let verificationText: TextChannel; + let bannedName = false; try { verificationText = await guild.channels.create(`✅┃${member.displayName}-verification`, { type: 'GUILD_TEXT', @@ -193,6 +193,13 @@ class VerificationJoinVCListener extends Listener { }, ], }); + bannedName = true; + } + + if (!bannedName) { + await channel.setName(`${member.displayName} - Verification`); + } else { + await channel.setName(`${member.id} - Verification`); } // Send a message that someone wants to be verified