mirror of
https://github.com/ION606/selmerBot.git
synced 2026-05-14 21:26:54 +00:00
Fixed the 'balance' command
This commit is contained in:
+2
-1
@@ -1,3 +1,4 @@
|
||||
node_modules
|
||||
config.json
|
||||
.env
|
||||
.env
|
||||
.sqlite
|
||||
@@ -104,16 +104,9 @@ module.exports = {
|
||||
}
|
||||
}
|
||||
} else if (command === 'balance') {
|
||||
//BROKEN PLEASE FIX!!!
|
||||
const target = message.author;
|
||||
let user = currency.get(target.id);
|
||||
|
||||
//let user = await Users.findOne({ where: { user_id: message.author.id } });
|
||||
if (!user) {
|
||||
const newUser = await Users.create({ user_id: user, balance: 0 });
|
||||
currency.set(target.id, newUser);
|
||||
} else { console.log(user); }
|
||||
return message.reply(`${target.tag} has \$${currency.getBalance(target)}`);
|
||||
currency.add(target.id, 0); //Make sure there's something
|
||||
return message.reply(`${target.tag} has \$${currency.getBalance(target.id)}`);
|
||||
} else if (command === 'inventory') {
|
||||
const target = message.author;
|
||||
const user = await Users.findOne({ where: { user_id: target.id } });
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user