first update to dev branch

This commit is contained in:
Marcus Netz
2020-11-21 21:29:18 +01:00
parent f468c4f7d6
commit 0136d087f5
14 changed files with 13519 additions and 1110 deletions

View File

@ -1,6 +1,31 @@
module.exports = async (message, args, db) => {
try {
console.log(message)
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,
silver: 0,
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
/*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)');
@ -9,4 +34,4 @@ module.exports = async (message, args, db) => {
message.reply('Dein Eintrag existiert bereits.');
}
});
};
};*/