Fixing Upload of Character Sheets. Adding talent which rolls dice on stored values.

This commit is contained in:
Marcus Netz
2020-11-22 22:02:14 +01:00
parent 210062b185
commit 072ae06253
7 changed files with 230 additions and 103 deletions

View File

@ -4,8 +4,6 @@ module.exports = async (message, args, db) => {
db.find({
user: message.author.tag
}, function (err, docs) {
// docs is an array containing documents Mars, Earth, Jupiter If no document is
// found, docs is equal to []
if(!docs.length>0)
db.insert({user: message.author.tag,
gold: 0,
@ -13,25 +11,10 @@ module.exports = async (message, args, db) => {
bronce: 0,
iron: 0,
hp: 0
})
console.log(docs)
});
} catch (e) {
throw e
}
}
// eslint-disable-next-line no-undef
/*db.query('SELECT * FROM dsageld WHERE userName = ' + '"' + message.author.tag + '"', function(err, row) { //the row is the user's data
if(row.length < 1) {
// eslint-disable-next-line no-undef
db.query('INSERT INTO `dsageld` (`userName`, `GD`,`ST`, `BH`, `EK`, `LP`) VALUES (' + '"' + message.author.tag + '"' + ', 0, 0, 0, 0, 0)');
message.reply('Dein Eintrag wurde registriert.');
} else if(row.length >= 1) {
message.reply('Dein Eintrag existiert bereits.');
}
});
};*/
}