Fixed file encoding issue & statistics command when guild has empty statistics

This commit is contained in:
Christer Warén
2020-03-31 10:23:46 +03:00
parent 3da41e44cb
commit 20d5d8b3bd
2 changed files with 17 additions and 15 deletions

View File

@ -76,7 +76,7 @@ module.exports = class {
saveEntry(file, data) {
data = JSON.stringify(data, null, 4);
fs.writeFile(path.join(path.dirname(__dirname), 'datastore') + "/" + file + ".json", data, function(err) {
fs.writeFile(path.join(path.dirname(__dirname), 'datastore') + "/" + file + ".json", data, 'utf8', function(err) {
if (err) {
//console.log(err);
}