Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require("discord.js");
- const client = new Discord.Client({
- disableEveryone : true,
- fetchAllMembers : true
- });
- const config = require("../../commanddata/config.json");
- const fs = require("fs");
- const snekfetch = require('snekfetch');
- const embedColor = require('../../commanddata/config.json');
- const db = require('quick.db');
- exports.run = async (client, message, args) => {
- db.set('inHand', 'bankAcct')
- const inHand = db.fetch(`money_${message.author.id}`)
- const bankAcct = db.fetch(`money_${message.guild.id}`)
- let help = new Discord.RichEmbed()
- .setTitle("Bank Commands")
- .setDescription("Here is a list of Banking commands")
- .setColor(client.config.embedcolor)
- .addField("Deposit", "``nb/bank deposit {amount}``\nDeposits the amount specified into your bank")
- .addField("Withdrawl", "``nb/bank withdrawl {amount}``\nWithdrawls the amount specified from your bank")
- if(!args[0] || args[0] == "help") return message.channel.send(help);
- if (args[0] == 'deposit') {
- if (!args[1]){
- return message.channel.send('Please specify an amount.')
- }
- if (message.content.includes('-')) { // if the message includes "-" do this.
- return message.channel.send('Negative money can not be deposited.')
- }
- if (inHand < args[1]) {
- return message.channel.send(`That's more money than you've got in your balance. try again.`)
- }
- message.channel.send(`<@${message.author.id}>, You successfully deposited $` + `${args[1]}`)
- db.subtract(`money_${message.author.id}`, args[1])
- db.add(`money_{message.guild.id}`, args[1])
- } else if(args[0] == 'withdrawl') {
- if (!args[1]){
- return message.channel.send('Please specify an amount.')
- }
- if (message.content.includes('-')) { // if the message includes "-" do this.
- return message.channel.send('Negative money can not be withdrawn.')
- }
- if (bankAcct < args[1]) {
- return message.channel.send(`That's more money than you've got in your bank. try again.`)
- }
- message.channel.send(`<@${message.author.id}>, You successfully deposited $` + `${args[1]}`)
- db.subtract(`money_{message.guild.id}`, args[1])
- db.add(`money_${message.author.id}`, args[1])
- }
- }
- exports.conf = {
- enabled: true,
- guildOnly: false,
- aliases: [],
- permLevel: 0
- };
- exports.help = {
- name: 'bank',
- description: 'WORK IN PROGRESS!!!',
- usage: 'nb/bank',
- permsissions: 'Everyone!',
- group: 'Economy Module'
- };
Add Comment
Please, Sign In to add comment