From 96825f6d389cf13956d9ab6c66a241e8ded1fede Mon Sep 17 00:00:00 2001 From: FelixLusseau Date: Tue, 2 Jan 2024 17:08:05 +0100 Subject: [PATCH] Cookies for player stats --- utils/functions.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils/functions.js b/utils/functions.js index 2cc4371..1a805c1 100644 --- a/utils/functions.js +++ b/utils/functions.js @@ -4,6 +4,8 @@ const path = require('node:path'); const https = require('node:https'); const puppeteer = require('puppeteer'); const { AttachmentBuilder, EmbedBuilder } = require('discord.js'); +const { promises } = require('dns'); +const { time } = require('console'); // Function to send an error embed function errorEmbed(bot, interaction, channel, error) { @@ -322,6 +324,9 @@ async function playerHistory(url) { // Accept cookies try { + await Promise.all([ + page.waitForSelector("button.css-47sehv"), + ]); await Promise.all([ page.click("button.css-47sehv"), ]);