Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require('discord.js');
- const { prefix, token} = require('./config.json')
- const client = new Discord.Client();
- const cmdPrefix = prefix
- // Embeds
- const helpEmbed = new Discord.RichEmbed()
- .setColor("#8b0000")
- .setAuthor("Prison")
- .addField("-Prestige {starting prestige} {ending prestige}", "Will calculate the cost to go from one prestige to another.")
- const prestigeEmbed = new Discord.RichEmbed()
- .setColor("#8b0000")
- .setAuthor("Prison")
- .setDescription("Here is a list of prestige commands!")
- .addField("-prestige {prestige}:", "Will provide the cost of a given prestige")
- .addField("-prestige {current prestige} {prestige}:", "Will provide the cost of leveling up from your prestige to a given prestige")
- client.on('ready', () =>{
- console.log('bot ready')
- })
- client.on('message', message => {
- prestigeCosts = client.channels.get('630102052395155477');
- msg = message.content.toLowerCase();
- msgSplit = msg.split(" ");
- console.log(message.author.username,"says","'",message.content,"'","at",message.createdAt)
- if (msg.startsWith(cmdPrefix + "help")) {
- if (message.channel !== prestigeCosts) {
- return message.channel.send("Please use #prestige-costs")
- }
- message.channel.send(helpEmbed)
- }
- if(msg.startsWith(cmdPrefix + "prestige")){
- if (message.channel !== prestigeCosts) {
- return message.channel.send("Please use #prestige-costs")
- }
- if(msg === "-prestige")
- message.channel.send(prestigeEmbed)
- if(msg === "-prestige " + msgSplit[1] + " " + msgSplit[2]){
- let startPrestige = Math.max(1, parseInt(msgSplit[1])) - 1
- let endPrestige = Math.min(1000, parseInt(msgSplit[2])) - 1
- let startCost = (731850000 * Math.pow(startPrestige, 2)) + (2561475000 * startPrestige) + (1829625000)
- let endCost = (731850000 * Math.pow(endPrestige, 2)) + (2561475000 * endPrestige) + (1829625000)
- let cost = endCost - startCost
- message.reply("It would cost $" + cost.toLocaleString() + " to prestige from " + msgSplit[1] + " to " + msgSplit[2])
- }
- }
- })
- client.login(token);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement