Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bot.on("message", async message => {
- if(message.author.bot) return;
- if(message.channel.type === "dm") return;
- if(!coins[message.author.id]){
- coins[message.author.id] = {
- coins: 0
- };
- }
- if(message.channel.id == "612891550531452938" || "612891766986899456" || "612891577018351616" || "612891783801602088" || "612891985853939736" || "612892005756043265" || "612892019559497728" || "612892033878589443"){
- if(!message.content.endsWith(".png") || message.content.endsWith(".jpg")) return
- let baseAmt = Math.floor(Math.random() * 1) + 1;
- let coinAmt = Math.floor(Math.random() * 1) + 1;
- let cAmt = Math.floor(Math.random() * 25) + 1;
- console.log(`${baseAmt} : ${coinAmt}`)
- if(coinAmt === baseAmt){
- coins[message.author.id] = {
- coins: coins[message.author.id].coins + cAmt
- };
- fs.writeFile("./coins.json", JSON.stringify(coins), (err) => {
- if (err) console.log(err)
- });
- let coinEmbed = new Discord.RichEmbed()
- .setDescription("Paid!")
- .setColor("#15f153")
- .addField("Player Name", message.author.username)
- .addField("Coin amount", cAmt);
- let sendChan = message.guild.channels.find(c => c.name == "transactions")
- sendChan.send(coinEmbed)
- };
- }
- let prefix = botconfig.prefix;
- let messageArray = message.content.split(" ");
- let cmd = messageArray[0];
- let args = messageArray.slice(1);
- if (message.content.startsWith(botconfig.prefix)) {
- let commandfile = bot.commands.get(cmd.slice(prefix.length));
- if(commandfile) commandfile.run(bot,message,args);
- console.log(message.author + "has run a command!")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement