From d419da210c9cede512cf7e278e8f7742a0f01ee9 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Thu, 5 Sep 2024 13:52:12 -0600 Subject: [PATCH] Add cookie cache, doesnt save them anywhere, just a QOL thing --- index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.js b/index.js index 169e048..74a5246 100644 --- a/index.js +++ b/index.js @@ -148,6 +148,7 @@ app.use((req, res, next) => { // Blacklist handler }) var rateLimits = {}; +var cookies = {}; // This gets cleared on restart app.get("/", (req, res) => { @@ -352,6 +353,7 @@ discord.on("interactionCreate", async (interaction) => { style: Discord.TextInputStyle.Paragraph, required: false, placeholder: "ROBLOSECURITY cookie", + value: cookies[interaction.user.id] ? cookies[interaction.user.id] : null, maxLength: 2000 } ] @@ -362,6 +364,9 @@ discord.on("interactionCreate", async (interaction) => { case Discord.InteractionType.ModalSubmit: assetId = interaction.fields.getTextInputValue("assetId"); cookie = interaction.fields.getTextInputValue("cookie"); + if (cookie) { + cookies[interaction.user.id] = cookie; + } bulk([new String(new Number(assetId))], cookie ? cookie : null).then((data) => { if (data.data[assetId].status == "failure") { return interaction.reply({