From 586ad8ef3e77e18041d32366c9a0c1826ecaba6e Mon Sep 17 00:00:00 2001 From: Fernando Date: Mon, 13 May 2024 14:06:58 -0300 Subject: [PATCH] fix --- Discord/discordIndex.js | 427 ++++++++++++++++++++++------------------ index.js | 2 - package-lock.json | 284 ++++++++++++++++++++++++++ package.json | 2 + 4 files changed, 518 insertions(+), 197 deletions(-) diff --git a/Discord/discordIndex.js b/Discord/discordIndex.js index a63b729..007b037 100644 --- a/Discord/discordIndex.js +++ b/Discord/discordIndex.js @@ -11,7 +11,7 @@ const { default: firebase } = require('firebase/compat/app'); const { firestore } = require('firebase-admin'); const functions = require('../functions.js'); const client = new Discord.Client({ intents: botConfig.intents }) - +var ncp = require("copy-paste"); client.login(botConfig.discordToken) @@ -46,52 +46,7 @@ module.exports = (Discord, client) => { } } - async function createRemoveEmbend(interaction, DiscordChannel, DiscordServer) { - var fields = [] - for (let index = 0; index < carrinhos[interaction.user.id].length; index++) { - const element = carrinhos[interaction.user.id][index]; - let serverData = await db.findOne({ colecao: "servers", doc: await interaction.guildId }) - let produto = await serverData.products.find(product => product.productID == element) - const valorReal = produto.price / 100; - let valorFormatado = valorReal.toLocaleString('pt-BR', { style: 'currency', currency: 'BRL' }); - await fields.push(await new Discord.StringSelectMenuOptionBuilder().setLabel(produto.productName).setDescription(valorFormatado).setValue(element)) - } - const botMessages = await DiscordChannel.messages.cache.filter(msg => msg.author.id === client.user.id); - const lastBotMessage = await botMessages.first(); - const row = new Discord.ActionRowBuilder().addComponents( - new Discord.StringSelectMenuBuilder() - .setCustomId('excludItem') - .setPlaceholder('Selecione o Item que deseja excluir!') - .setMinValues(1) - .setMaxValues(1) - .addOptions(...fields) - ) - const row2 = new Discord.ActionRowBuilder() - .addComponents( - new Discord.ButtonBuilder() - .setCustomId(`exclud`) - .setLabel('Excluir') - .setStyle('4'), - ) - .addComponents( - new Discord.ButtonBuilder() - .setCustomId('back') - .setLabel('Voltar') - .setStyle('3') - ) - await lastBotMessage.edit({ - embeds: [ - new Discord.EmbedBuilder() - .setTitle('Selecione abaixo o item que deseja excluir!') - .setDescription(`Clique em cancelar caso desista de excluir um item!`) - .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png`, url: 'https://discord.gg/sdkapps' }) - .setColor("#6E58C7") - .setThumbnail(`https://cdn.discordapp.com/icons/${DiscordServer.id}/${DiscordServer.icon}.webp`) - .setFooter({ text: DiscordServer.name, iconURL: `https://cdn.discordapp.com/icons/${DiscordServer.id}/${DiscordServer.icon}.webp` }) - ], - components: [row, row2] - }) - } + client.on('interactionCreate', async (interaction) => { try { var DiscordServer = await client.guilds.cache.get(interaction.guildId); @@ -106,6 +61,62 @@ module.exports = (Discord, client) => { } + async function createRemoveEmbend() { + try { + var fields = [] + for (let index = 0; index < carrinhos[interaction.user.id].length; index++) { + const element = carrinhos[interaction.user.id][index].product; + let serverData = await db.findOne({ colecao: "servers", doc: await interaction.guildId }) + let produto = await serverData.products.find(product => product.productID == element) + const valorReal = produto.price / 100; + let valorFormatado = valorReal.toLocaleString('pt-BR', { style: 'currency', currency: 'BRL' }); + await fields.push(await new Discord.StringSelectMenuOptionBuilder().setLabel(produto.productName).setDescription(valorFormatado).setValue(element)) + } + const botMessages = await DiscordChannel.messages.cache.filter(msg => msg.author.id === client.user.id); + const lastBotMessage = await botMessages.first(); + const row = new Discord.ActionRowBuilder().addComponents( + new Discord.StringSelectMenuBuilder() + .setCustomId('excludItem') + .setPlaceholder('Selecione o Item que deseja excluir!') + .setMinValues(1) + .setMaxValues(1) + .addOptions(...fields) + ) + const row2 = new Discord.ActionRowBuilder() + .addComponents( + new Discord.ButtonBuilder() + .setCustomId(`exclud`) + .setLabel('Excluir') + .setStyle('4'), + ) + .addComponents( + new Discord.ButtonBuilder() + .setCustomId('back') + .setLabel('Voltar') + .setStyle('3') + ) + await lastBotMessage.edit({ + embeds: [ + new Discord.EmbedBuilder() + .setTitle('Selecione abaixo o item que deseja excluir!') + .setDescription(`Clique em cancelar caso desista de excluir um item!`) + .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png`, url: 'https://discord.gg/sdkapps' }) + .setColor("#6E58C7") + .setThumbnail(`https://cdn.discordapp.com/icons/${DiscordServer.id}/${DiscordServer.icon}.webp`) + .setFooter({ text: DiscordServer.name, iconURL: `https://cdn.discordapp.com/icons/${DiscordServer.id}/${DiscordServer.icon}.webp` }) + ], + components: [row, row2] + }).then((res)=>{ + + }).catch((err)=>{ + console.log(err); + }) + } catch (error) { + console.log(error); + } + } + + if (interaction.customId && interaction.customId.includes('qntProduct')) { if (!preCarrinhos[interaction.user.id]) { preCarrinhos[interaction.user.id] = [] @@ -119,6 +130,7 @@ module.exports = (Discord, client) => { } + // interacao do botao de compra de um produto if (interaction.customId && interaction.customId.includes('comprar')) { let server = await db.findOne({ colecao: "servers", doc: interaction.guildId }) @@ -176,7 +188,15 @@ module.exports = (Discord, client) => { await deleteExpiredCart(interaction.guildId, interaction, findChannel.id) return } - findUniCarrinhos() + let prodid = await interaction.customId.replace('comprar_', '') + let findProductCart = await carrinhos[interaction.user.id].find((item)=>item.product == prodid) + let findProductCartIndex = await carrinhos[interaction.user.id].findIndex((item)=>item.product == prodid) + if (findProductCart) { + carrinhos[interaction.user.id][findProductCartIndex].quantidade = parseInt(carrinhos[interaction.user.id][findProductCartIndex].quantidade) + 1 + }else{ + findUniCarrinhos() + } + interaction.reply({ embeds: [ new Discord.EmbedBuilder() @@ -267,7 +287,14 @@ module.exports = (Discord, client) => { - + if (interaction.customId == 'copyPix') { + const botMessages = await DiscordChannel.messages.cache.filter(msg => msg.author.id === client.user.id); + const lastBotMessage = await botMessages.first(); + let desc = await lastBotMessage.embeds[0].data.description + let code = await desc.replace('Pix Copiar e Colar:', "").replace(/\*/g, '').replace(/\```/g, '').trim() + ncp.copy(code) + interaction.reply({content:'✅ | Codigo copiado para a area de transferencia.',ephemeral: true}) + } @@ -392,8 +419,8 @@ module.exports = (Discord, client) => { notification_url: `${mercadoPagoData.notification_url}/mercadopago/webhook?token=${serverData.bankData.mercadoPagoToken}`, metadata: { userID: interaction.user.id, - serverID:interaction.guildId, - carrinhos:JSON.stringify(carrinho), + serverID: interaction.guildId, + carrinhos: JSON.stringify(carrinho), token: serverData.bankData.mercadoPagoToken } }; @@ -409,7 +436,7 @@ module.exports = (Discord, client) => { new Discord.EmbedBuilder() .setTitle('Pague o seu carrinho pelo qrcode ou pelo pix copiar e colar abaixo!') .setDescription(`Pix Copiar e Colar: - **${cpc}**`) + ${'**```'+ cpc + '```**'}`) .setImage('attachment://qrcodepix.png') .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png`, url: 'https://discord.gg/sdkapps' }) .setFooter({ text: DiscordServer.name, iconURL: `https://cdn.discordapp.com/icons/${DiscordServer.id}/${DiscordServer.icon}.webp` }) @@ -421,7 +448,14 @@ module.exports = (Discord, client) => { .setLabel('Cancelar') .setStyle('4') )], - files: [attachment] + files: [attachment], + components:[new Discord.ActionRowBuilder() + .addComponents( + new Discord.ButtonBuilder() + .setCustomId(`copyPix`) + .setLabel('Copiar Codigo') + .setStyle('2'), + )] }) }).catch((error) => { @@ -476,11 +510,7 @@ module.exports = (Discord, client) => { await DiscordChannel.delete() return } - interaction.deferReply(); - interaction.deleteReply() createRemoveEmbend(interaction, DiscordChannel, DiscordServer) - - } if (interaction.customId == 'exclud') { @@ -615,7 +645,7 @@ module.exports = (Discord, client) => { } }) } catch (error) { - console.log(error); + console.log('totalDiscordIndex: ', error); } } @@ -657,86 +687,146 @@ module.exports.sendProductPayment = async (params, id, type) => { }) .catch(reject); }); + async function refound() { + const fetched = await findChannel.messages.fetch({ limit: 100 }); + findChannel.bulkDelete(fetched) + if (type == 'aprovado') { + await findChannel.send({ + embeds: [ + new Discord.EmbedBuilder() + .setTitle(`${DiscordServer.name} | Falta de estoque`) + .setDescription(`Não foi possivel aprovar o carrinho por falta de estoque!`) + ] + }).catch(() => { }) + return + } + await findChannel.send({ + embeds: [ + new Discord.EmbedBuilder() + .setTitle(`${DiscordServer.name} | Reembolso`) + .setDescription(`Você Recebeu Reembolso porque alguem comprou primeiro!`) + ] + }).catch(() => { }) + if (type == 'pix') { + try { + + await axios.post(`https://api.mercadopago.com/v1/payments/${id}/refunds`, {}, { + headers: { + Authorization: `Bearer ${params.token}` + } + }) + + } catch (error) { } + } else { + try { + await stripe.refunds.create({ + payment_intent: id, + }); + } catch (error) { + + } + } + let analytics = await db.findOne({ colecao: "analytics", doc: serverData.id }) + + if (analytics.error == false) { + let reebolsos = analytics['reebolsos'] + await reebolsos.push(await functions.formatDate(new Date())) + db.update('analytics', serverData.id, { + "reebolsos": reebolsos + }) + } else { + db.create('analytics', serverData.id, { + "cancelados estoque": [], + "pagamentos": { + "PIX": 0, + "card": 0, + "boleto": 0, + }, + "reebolsos": [await functions.formatDate(new Date())], + "vendas canceladas": [], + "vendas completas": [] + }) + } + carrinhos[params.userID] = null + } if (result == true) { async function createTextContentFromObjects(objectsArray) { let textContent = ''; - await objectsArray.forEach(obj => { - textContent += `${obj.title}: ${obj.content}\n\n`; + await objectsArray.forEach(async (obj, index) => { + await obj.forEach((line, index2) => { + textContent += `${line.title}: ${line.content}\n`; + }) }); return textContent; } - async function sendTextBufferToDiscordChannel(objectsArray) { - try { - const textContent = await createTextContentFromObjects(objectsArray); - const buffer = Buffer.from(textContent, 'utf-8'); - return buffer - } catch (error) { - console.error('Erro ao enviar arquivo para o Discord:', error); - } - } - const user = await client.users.fetch(params.userID); let fields = [] await carrinho.forEach(async (element, index) => { - for (let index = 0; index < parseInt(element.quantidade); index++) { - try { - var product = await serverData.products.find(product => product.productID == element.product) - var productIndex = await serverData.products.findIndex(product => product.productID == element.product) - let estoqueData = await serverData.products[productIndex].estoque - let buffer = await sendTextBufferToDiscordChannel(estoqueData[0].conteudo); - fields.push({ attachment: buffer, name: `${product.productName}.txt` },) - await estoqueData.splice(0, 1); - product.estoque = estoqueData - serverData.products[productIndex] = product - - await db.update('servers', serverData.id, { - products: serverData.products - }) - if (index == parseInt(element.quantidade) - 1) { - try { - let DiscordServer = await client.guilds.cache.get(serverData.id); - let findProductChannel = DiscordServer.channels.cache.find(c => c.id === product.channel) - const fetchedMessage = await findProductChannel.messages.fetch(product.mensageID); - if (fetchedMessage) { - let totalEstoque = [] - if (product.estoque.length > 0) { - let estoque = product.estoque.length > 25 ? 25 : produto.estoque.length - for (let index2 = 0; index2 < estoque; index2++) { - let indexSring1 = `${index2 + 1}` - if (index == 0) { - totalEstoque.push(new Discord.StringSelectMenuOptionBuilder().setLabel(indexSring1).setValue(indexSring1).setDefault(true),) - } else { - totalEstoque.push(new Discord.StringSelectMenuOptionBuilder().setLabel(indexSring1).setValue(indexSring1),) + try { + var product = await serverData.products.find(product => product.productID == element.product) + var productIndex = await serverData.products.findIndex(product => product.productID == element.product) + let estoqueData = await serverData.products[productIndex].estoque + let arrayCarrinhoProd = [] + if (parseInt(element.quantidade) <= estoqueData.length) { + for (let index = 0; index < parseInt(element.quantidade); index++) { + arrayCarrinhoProd.push(estoqueData[0].conteudo) + await estoqueData.splice(0, 1); + if (index == parseInt(element.quantidade) - 1) { + try { + let DiscordServer = await client.guilds.cache.get(serverData.id); + let findProductChannel = DiscordServer.channels.cache.find(c => c.id === product.channel) + const fetchedMessage = await findProductChannel.messages.fetch(product.mensageID); + if (fetchedMessage) { + let totalEstoque = [] + if (product.estoque.length > 0) { + let estoque = product.estoque.length > 25 ? 25 : product.estoque.length + for (let index2 = 0; index2 < estoque; index2++) { + let indexSring1 = `${index2 + 1}` + if (index == 0) { + totalEstoque.push(new Discord.StringSelectMenuOptionBuilder().setLabel(indexSring1).setValue(indexSring1).setDefault(true),) + } else { + totalEstoque.push(new Discord.StringSelectMenuOptionBuilder().setLabel(indexSring1).setValue(indexSring1),) + } + } - } + fetchedMessage.edit({ + components: [ + new Discord.ActionRowBuilder().addComponents( + new Discord.StringSelectMenuBuilder() + .setCustomId(`qntProduct_${product.productID}`) + .setPlaceholder('Selecione a quantidade!') + .setMinValues(1) + .setMaxValues(1) + .addOptions(...totalEstoque) + .setDisabled(product.estoque.length <= 0 ? true : false) + ), + new Discord.ActionRowBuilder().addComponents( + new Discord.ButtonBuilder() + .setCustomId(`comprar_${product.productID}`) + .setLabel('Comprar') + .setStyle('3'), + ) + ] + }).catch((err) => { + console.log(err); + }) + } else { + require('../Discord/createProductMessage.js')(Discord, client, { + channelID: product.channel, + serverID: params.serverID, + productID: element.product, + edit: true + }) } - - fetchedMessage.edit({ - components: [ - new Discord.ActionRowBuilder().addComponents( - new Discord.StringSelectMenuBuilder() - .setCustomId(`qntProduct_${product.productID}`) - .setPlaceholder('Selecione a quantidade!') - .setMinValues(1) - .setMaxValues(1) - .addOptions(...totalEstoque) - .setDisabled(product.estoque.length <= 0 ? true : false) - ), - new Discord.ActionRowBuilder().addComponents( - new Discord.ButtonBuilder() - .setCustomId(`comprar_${product.productID}`) - .setLabel('Comprar') - .setStyle('3'), - ) - ] - }) - }else{ + + } catch (error) { + console.log(error); require('../Discord/createProductMessage.js')(Discord, client, { channelID: product.channel, serverID: params.serverID, @@ -744,22 +834,27 @@ module.exports.sendProductPayment = async (params, id, type) => { edit: true }) } - - } catch (error) { - require('../Discord/createProductMessage.js')(Discord, client, { - channelID: product.channel, - serverID: params.serverID, - productID: element.product, - edit: true - }) } } - } catch (error) { - console.log(error); + } else { + refound() + return } + let content = await createTextContentFromObjects(arrayCarrinhoProd); + fields.push({ name: "**" + product.productName + ': **', value: "```" + content + "```" },) + product.estoque = estoqueData + serverData.products[productIndex] = product + await db.update('servers', serverData.id, { + products: serverData.products + }) + + + } catch (error) { + console.log(error); } + }); const dataHoraAtual = new Date(); const dataHoraFormatada = `${String(dataHoraAtual.getDate()).padStart(2, '0')}/${String(dataHoraAtual.getMonth() + 1).padStart(2, '0')}/${dataHoraAtual.getFullYear()} ${String(dataHoraAtual.getHours()).padStart(2, '0')}:${String(dataHoraAtual.getMinutes()).padStart(2, '0')}:${String(dataHoraAtual.getSeconds()).padStart(2, '0')}`; @@ -778,15 +873,14 @@ module.exports.sendProductPayment = async (params, id, type) => { { name: 'ID do usuario', value: user.id, inline: true }, { name: 'ID da compra', value: findChannel.id }, { name: 'Data e hora da compra', value: dataHoraFormatada }, - { name: '\u200B', value: '\u200B' } + { name: '\u200B', value: '\u200B' }, + ...fields ) .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png`, url: 'https://discord.gg/sdkapps' }) .setColor("#6E58C7") .setFooter({ text: DiscordServer.name, iconURL: `https://cdn.discordapp.com/icons/${DiscordServer.id}/${DiscordServer.icon}.webp` }) ], }).catch(() => { }) - dono.send({ files: fields }).catch(() => { }) - await user.send({ embeds: [ new Discord.EmbedBuilder() @@ -794,10 +888,10 @@ module.exports.sendProductPayment = async (params, id, type) => { .setDescription(`Abaixo estão os dados da sua entrega:`) .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png`, url: 'https://discord.gg/sdkapps' }) .setColor("#6E58C7") + .addFields(...fields) .setFooter({ text: DiscordServer.name, iconURL: `https://cdn.discordapp.com/icons/${DiscordServer.id}/${DiscordServer.icon}.webp` }) ], }).catch(() => { }) - user.send({ files: fields }).catch(() => { }) const fetched = await findChannel.messages.fetch({ limit: 100 }); findChannel.bulkDelete(fetched) findChannel.send({ @@ -807,6 +901,7 @@ module.exports.sendProductPayment = async (params, id, type) => { .setDescription(`Enviamos a entrega no seu privado caso não tenha recebido o seu privado pode esta bloqueado então tenha certeza de baixar os arquivos antes que o carrinho seja fechado`) .setAuthor({ name: "SDKApps", iconURL: `https://res.cloudinary.com/dgcnfudya/image/upload/v1711769157/vyzyvzxajoboweorxh9s.png`, url: 'https://discord.gg/sdkapps' }) .setColor("#6E58C7") + .addFields(...fields) .setFooter({ text: DiscordServer.name, iconURL: `https://cdn.discordapp.com/icons/${DiscordServer.id}/${DiscordServer.icon}.webp` }) ], @@ -819,7 +914,6 @@ module.exports.sendProductPayment = async (params, id, type) => { .setCustomId('cancel') ) ], - files: fields }); @@ -832,7 +926,7 @@ module.exports.sendProductPayment = async (params, id, type) => { await carrinho.forEach(async (element, index) => { var product = await serverData.products.find(product => product.productID == element.product) valorTotal = valorTotal + parseInt(product.price) - fieldsPublic.value += `${index + 1} - ${product.productName}\n` + fieldsPublic.value += `${index + 1} - ${product.productName} - ${element.quantidade}x\n` }); fieldsPublic = { name: fieldsPublic.name, value: "`" + fieldsPublic.value + "`" } let price = await functions.formatarMoeda(valorTotal) @@ -904,64 +998,7 @@ module.exports.sendProductPayment = async (params, id, type) => { } } else { - if (type == 'aprovado') { - await findChannel.send({ - embeds: [ - new Discord.EmbedBuilder() - .setTitle(`${DiscordServer.name} | Falta de estoque`) - .setDescription(`Não foi possivel aprovar o carrinho por falta de estoque!`) - ] - }).catch(() => { }) - return - } - await findChannel.send({ - embeds: [ - new Discord.EmbedBuilder() - .setTitle(`${DiscordServer.name} | Reembolso`) - .setDescription(`Você Recebeu Reembolso porque alguem comprou primeiro!`) - ] - }).catch(() => { }) - if (type == 'pix') { - try { - - await axios.post(`https://api.mercadopago.com/v1/payments/${id}/refunds`, {}, { - headers: { - Authorization: `Bearer ${params.token}` - } - }) - - } catch (error) { } - } else { - try { - await stripe.refunds.create({ - payment_intent: id, - }); - } catch (error) { - - } - } - let analytics = await db.findOne({ colecao: "analytics", doc: serverData.id }) - - if (analytics.error == false) { - let reebolsos = analytics['reebolsos'] - await reebolsos.push(await functions.formatDate(new Date())) - db.update('analytics', serverData.id, { - "reebolsos": reebolsos - }) - } else { - db.create('analytics', serverData.id, { - "cancelados estoque": [], - "pagamentos": { - "PIX": 0, - "card": 0, - "boleto": 0, - }, - "reebolsos": [await functions.formatDate(new Date())], - "vendas canceladas": [], - "vendas completas": [] - }) - } - carrinhos[params.userID] = null + refound() } try { setTimeout(async () => { diff --git a/index.js b/index.js index 7425ca5..e61a45e 100644 --- a/index.js +++ b/index.js @@ -91,8 +91,6 @@ const storage = multer.diskStorage({ const upload = multer({ storage }); - - //TODO------------Clients discord-------------- client.on("interactionCreate", async (interaction) => { diff --git a/package-lock.json b/package-lock.json index f940c4d..334bc14 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,9 @@ "axios": "^1.6.7", "body-parser": "^1.20.2", "canvas": "^2.11.2", + "clipboardy": "^4.0.0", "cookie-parser": "^1.4.6", + "copy-paste": "^1.5.3", "cors": "^2.8.5", "discord.js": "^14.12.1", "dotenv": "^16.4.5", @@ -2014,6 +2016,22 @@ "node": ">=10" } }, + "node_modules/clipboardy": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/clipboardy/-/clipboardy-4.0.0.tgz", + "integrity": "sha512-5mOlNS0mhX0707P2I0aZ2V/cmHUEO/fL7VFLqszkhUsxt7RwnmrInf/eEQKlf5GzvYeHIjT+Ov1HRfNmymlG0w==", + "dependencies": { + "execa": "^8.0.1", + "is-wsl": "^3.1.0", + "is64bit": "^2.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -2209,6 +2227,14 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, + "node_modules/copy-paste": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/copy-paste/-/copy-paste-1.5.3.tgz", + "integrity": "sha512-qOnFo+8l8vemGmdcoCiD7gPTefkXEg2rivYE+EBtuKOj754eFivkGhGAM9e/xqShrpuVE11evSxGnHwVAUK1Iw==", + "dependencies": { + "iconv-lite": "^0.4.8" + } + }, "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", @@ -2226,6 +2252,19 @@ "node": ">= 0.10" } }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -2530,6 +2569,61 @@ "node": ">=6" } }, + "node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/execa/node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/execa/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/execa/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/express": { "version": "4.19.2", "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", @@ -3412,6 +3506,14 @@ "node": ">= 14" } }, + "node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "engines": { + "node": ">=16.17.0" + } + }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -3455,6 +3557,20 @@ "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" }, + "node_modules/is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -3463,6 +3579,23 @@ "node": ">=8" } }, + "node_modules/is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "dependencies": { + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", @@ -3480,11 +3613,44 @@ "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" }, + "node_modules/is-wsl": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", + "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==", + "dependencies": { + "is-inside-container": "^1.0.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is64bit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is64bit/-/is64bit-2.0.0.tgz", + "integrity": "sha512-jv+8jaWCl0g2lSBkNSVXdzfBA0npK1HGC2KtWM9FumFRoGS94g3NbCCLVnCYHLjp4GrW2KZeeSTMo5ddtznmGw==", + "dependencies": { + "system-architecture": "^0.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, "node_modules/isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", @@ -3818,6 +3984,11 @@ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" + }, "node_modules/methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", @@ -3857,6 +4028,17 @@ "node": ">= 0.6" } }, + "node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/mimic-response": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", @@ -4064,6 +4246,31 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-path/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/npmlog": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", @@ -4135,6 +4342,20 @@ "wrappy": "1" } }, + "node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-cancelable": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", @@ -4232,6 +4453,14 @@ "node": ">=0.10.0" } }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "engines": { + "node": ">=8" + } + }, "node_modules/path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", @@ -4813,6 +5042,25 @@ "@img/sharp-win32-x64": "0.33.2" } }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "engines": { + "node": ">=8" + } + }, "node_modules/side-channel": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.5.tgz", @@ -4981,6 +5229,17 @@ "node": ">=8" } }, + "node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/stripe": { "version": "14.19.0", "resolved": "https://registry.npmjs.org/stripe/-/stripe-14.19.0.tgz", @@ -5099,6 +5358,17 @@ "node": ">= 0.8.0" } }, + "node_modules/system-architecture": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/system-architecture/-/system-architecture-0.1.0.tgz", + "integrity": "sha512-ulAk51I9UVUyJgxlv9M6lFot2WP3e7t8Kz9+IS6D4rVba1tR9kON+Ey69f+1R4Q8cd45Lod6a4IcJIxnzGc/zA==", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/tar": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", @@ -5402,6 +5672,20 @@ "webidl-conversions": "^3.0.0" } }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/which-module": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", diff --git a/package.json b/package.json index 0af48f3..f1c418b 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,9 @@ "axios": "^1.6.7", "body-parser": "^1.20.2", "canvas": "^2.11.2", + "clipboardy": "^4.0.0", "cookie-parser": "^1.4.6", + "copy-paste": "^1.5.3", "cors": "^2.8.5", "discord.js": "^14.12.1", "dotenv": "^16.4.5",