I have a JSON File: (invitelist.json)
{
}
Every time the "guildMemberAdd" event gets fired off, an invite is created:
bot.channels.get('642609367195189268').createInvite({
temporary: false,
maxAge: 0,
maxUses: 0,
unique: true
},`This is ${member}'s invite link.`).then(invite => {
bot.channels.get('642609367195189268').send(invite.code);
});
How do I append to the JSON File?:
{
"invite": {
"code": "",
"timecreated": "",
"author": ""
}
}
When a new invite is created, it'll add another invite object:
{
"invite-1": {
"code": "",
"timecreated": "",
"author": ""
},
"invite-2": {
"code": "",
"timecreated": "",
"author": ""
}
}
The address to the invitelist.json is simply invitelist.json.
If you could please provide me some code and most importantly what the result of your solution to this question will look like, that'd be great, oh and explanation of how your solutions works would be awesome too! Thanks
If you need more information please just kindly ask in the comments below :D