From c782c9eb4b67603284dc6b9acbde76a9d2fdca00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20J=C3=BAnio?= Date: Mon, 11 Nov 2024 15:31:25 -0300 Subject: [PATCH] Update discordIndex.js --- Discord/discordIndex.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Discord/discordIndex.js b/Discord/discordIndex.js index 9c7867a..7dbdc42 100644 --- a/Discord/discordIndex.js +++ b/Discord/discordIndex.js @@ -2050,7 +2050,8 @@ module.exports.sendProductPayment = async (params, id, type) => { let findChannel = DiscordServer.channels.cache.find(c => c.topic === params.userID && c.name && c.name.includes('🛒・carrinho・')) let serverData = await db.findOne({ colecao: "servers", doc: params.serverID }) if (DiscordServer && findChannel && serverData) { - let carrinho = JSON.parse(params.carrinhos) + let carrinho = carrinhos[params.userID] + delete carrinhos[params.userID] let result = await new Promise(async(resolve, reject) => { for (let [chave, element] of Object.entries(carrinho)) { const produto = serverData.products.find(product => product.productID == element.product); @@ -2139,7 +2140,6 @@ module.exports.sendProductPayment = async (params, id, type) => { "vendas completas": [] }) } - carrinhos[params.userID] = null } if (result == true) { @@ -2413,7 +2413,6 @@ module.exports.sendProductPayment = async (params, id, type) => { } else { refound() } - carrinhos[params.userID] = [] try { setTimeout(async () => { var DiscordServer2 = await client.guilds.cache.get(params.serverID); @@ -2495,4 +2494,4 @@ module.exports.sendDiscordMensageUser = async (user, title, mensage, buttonRef, } } -module.exports.client = client \ No newline at end of file +module.exports.client = client