Skip to content

Commit

Permalink
Update discordIndex.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando-Santana-j authored Nov 11, 2024
1 parent 80df5cf commit c782c9e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Discord/discordIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -2139,7 +2140,6 @@ module.exports.sendProductPayment = async (params, id, type) => {
"vendas completas": []
})
}
carrinhos[params.userID] = null
}

if (result == true) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -2495,4 +2494,4 @@ module.exports.sendDiscordMensageUser = async (user, title, mensage, buttonRef,
}
}

module.exports.client = client
module.exports.client = client

0 comments on commit c782c9e

Please sign in to comment.