Add cookie cache, doesnt save them anywhere, just a QOL thing

This commit is contained in:
Christopher Cookman 2024-09-05 13:52:12 -06:00
parent 3f8178eff6
commit d419da210c
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

View file

@ -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({