Skip to content

Commit f182348

Browse files
committed
Changes
- Fixed WaldyBot's version number pathing to package.json. - Version number now correctly outputs to console on startup.
1 parent 12ed8db commit f182348

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

WaldyBot.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,16 @@ process.setMaxListeners(0);
1313

1414

1515
// Global Vars
16-
var packageJson = { };
17-
fs.readFile('./package.json', function(data){
18-
return packageJson = data;
19-
});
20-
const waldyBotVersion = packageJson["version"];
16+
var packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
17+
var waldyBotVersion = packageJson["version"];
2118
const authToken = globalVarsObjs.authenticationObject.authToken; // WaldyBot
2219
const authTokenBeta = globalVarsObjs.authenticationObject.authTokenBeta; // WaldyBot Beta
2320

2421

2522
// Startup
2623
client.on('ready', () => {
27-
console.log('Ready....');
28-
console.log(waldyBotVersion);
24+
console.log('v' + waldyBotVersion);
25+
console.log('Ready....');
2926
}
3027
);
3128

0 commit comments

Comments
 (0)