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