From 5a7658a34f63c762f280944793bfdbd4bcd206d4 Mon Sep 17 00:00:00 2001 From: kdh8219 <65698239+kdh8219@users.noreply.github.com> Date: Sat, 29 Apr 2023 00:40:52 +0900 Subject: [PATCH] fix del_nick_super not deleting nickname --- src/command/commands/del_nick_super.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/command/commands/del_nick_super.ts b/src/command/commands/del_nick_super.ts index eb7bd72..7c3a9ec 100755 --- a/src/command/commands/del_nick_super.ts +++ b/src/command/commands/del_nick_super.ts @@ -40,14 +40,15 @@ export default { return; } const members = firebase.collection("members"); - if ( - !( - await members - .where("minecraft_uuid", "==", mcuuid) - .where("discord_id", "==", discord_id) - .get() - ).empty - ) { + const the_member = await members + .where("minecraft_uuid", "==", mcuuid) + .where("discord_id", "==", discord_id) + .get(); + if (!the_member.empty) { + the_member.forEach((member) => { + members.doc(member.id).delete(); + }); + let discord_tag; try { const discord_user = await interaction.client.users.fetch(discord_id);