discord-bosey
v1.0.99
Published
Add Premium mode to its discord bot (discord.js)
Downloads
74
Readme
Utilisation :
Please create a bdd.json file
Interior of the file (bdd.json) :
{}
const client = new Discord.Client()
const Discord = require('discord.js')
const bdd = require('./bdd.json')
const Save = require('discord-bosey')
const PremiumCode = "premium code"
//Command to activate the premium
client.on('message', async message => {
if (message.content.startsWith('!premium ' + PremiumCode)){
message.channel.send('premium activé')
function Save() {
fs.writeFileSync("./bdd.json", JSON.stringify(bdd, null, 4));
}
bdd[message.guild.id]["premium-mode"] = true
Save()
}
})
//Command with the premium
client.on('message', async message => {
if (message.content.startsWith('!cmdpremium')){
if (!bdd[message.guild.id]["premium-mode"] == true) {
return message.channel.send('Premium not activated!')
}
if (bdd[message.guild.id]["premium-mode"] == true) {
message.channel.send('Premium well activated !')
}
}
})