Skip to content
Snippets Groups Projects
Commit fb13cc9f authored by Levatax's avatar Levatax
Browse files

Added send command,

Fixed negative number bug
parent 362484e2
Branches
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@ const db = require('quick.db');
exports.run = async(bot, message, args) => {
let number = args[0];
let bal = await db.get(`Balance_${message.author.id}`);
if (number > bal || bal == 0) return message.channel.send(`Your balance is under the value you entered.`)
if (number > bal || number <= 0|| !bal) return message.channel.send(`Your balance is under the value you entered.`)
let cfNumber;
if (!number) return message.channel.send('Please specify an amout to use.');
if (number > 50000 || number == "all") {
......
const Discord = require('discord.js');
const db = require('quick.db');
exports.run = async(bot, message, args) => {
let sender = message.author.id;
let target = message.guild.member(message.mentions.users.first() || message.guild.members.cache.get(args[0]));
let amount = parseInt(args[1]);
if (target.user.id == sender) return message.channel.send(`You can't send money to yourself?`)
let bal = await db.get(`Balance_${message.author.id}`);
if (amount > bal || amount <= 0 || !bal) return message.channel.send(`Your balance is under the value you entered.`);
else{
await db.subtract(`Balance_${sender}`, amount);
await db.add(`Balance_${target.user.id}`, amount);
message.channel.send(`Sent ${amount}$ to <@${target.user.id}>`)
}
};
module.exports.help = {
name: 'send',
aliases: ['give','ver']
};
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment