Skip to content

Commit

Permalink
Cookies for player stats
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixLusseau committed Jan 2, 2024
1 parent d98401a commit 96825f6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions utils/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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"),
]);
Expand Down

0 comments on commit 96825f6

Please sign in to comment.