Here's my code:
const Discord = require('discord.js');
const client = new Discord.Client();
const fs = require('fs');
client.msgs = require ('./archives.json')
client.once('ready', () => {
console.log('Hi!')
})
client.on("message", async message => {
if (message.content.startsWith ("*archive")) {
editedmessage = message.content.slice (8);
client.msgs [message.author.username] = {
message: editedmessage
}
fs.writeFileSync ("./archives.json", JSON.stringify (client.msgs, null, 4,
message.channel.send("Message archived")
));
}})
My goal is to have the bot write multiple items from the same person instead of overwriting it. How would I go about doing that? sorry if my code looks messy or something.