I'm using the whatsapp-web.js library and I would like to stay logged in after restarting the script. Currently I have to scan the QR code every time I start. The things I found online couldn't get to work (probably cuz I'm dumb but still). For reference this is the code I am trying to get it working with.
const { Client, LocalAuth, MessageMedia } = require('whatsapp-web.js');
const fs = require('fs');
const client = new Client({
ffmpegPath: "C:/ffmpeg/bin/ffmpeg.exe"
});
client.on('qr', async qr=> {
qrcode.generate(qr, {small: true});
});
client.on('ready', async function () {
console.log('Client is ready!');
});
Thanks in advance.