I'm creating a crawler to parse a game I have this function on the main file (crawler.js)
function kicked() {
try {
info.logged = false;
info.next_login = 0;
info.login_tries = 0;
report('Crawler disconnected from game, reconnecting.');
}
catch (error) {
report('Disconected() error => ' + error);
}
}
And i have
module.exports = { kicked: kicked };
and in another file (renew session) i have
var crawler = require('../../crawler');
but when i call the crawler.kicked()
i get undefined and if i use console.log(crawler);
it shows an empty object no errors nothing, just an empty object and i can't find why the file isn't exporting the function any help ?