I want to get the number of new sender and save it in a text file. Is this possible to achieve? any help would be appreciated. Thanks
if (!(sender in userInfo)) {
console.log("This is a new user.");
// Create a text file and write the sender number to it
fs.writeFile('new_users.txt', sender, (err) => {
if (err) throw err;
console.log('Sender number added to new_users.txt');
});
client.sendMessage(sender, greetings, { mentions: [contact] });
userInfo[sender] = {
"mode": "mode 1",
"currentStage": "begin",
"voice_id": "base",
"elevenLabsLatency": 3,
};
return;
}```