I am currently working on a members bot. I'm trying to make it so the bot creates an invite and then it gets saved on the JSON file called "servers.json" and the output should be similar to the following...
{
"GUILD_ID":"INVITE TOKEN"
}
At the moment, it just creates the invite. Any suggestions?
The command is
if (message.content == `${PREFIX}setup`) {
if (!message.member.hasPermission("ADMINISTRATOR"))
return message.reply("Nope, you can't since you don't have permissions.");
message.channel
.createInvite({ unique: true, maxAge: 0, maxUses: 0 })
.then(invite => {
let invvembed = new Discord.MessageEmbed()
.setTitle("Setup command")
.setDescription(
`Setup has been completed. Invite link is https://discord.gg/${invite.code}. Make sure to keep this invite on forever. Now once you have bought the access for your code, your server should popup on **g+find**`
)
.setFooter("Setup");
message.channel.send(invvembed);
})
}