Creating bot on steam
- Node.js Version: 8.11.2 LTS
- OS: Windows
- Scope (install, code, runtime, meta, other?):
- Module (and version) (if relevant):
const SteamUser = require ('steam-user');
const config = require('./config.json');
const client = new SteamUser();
const LogOnOptions = {
accountname: config.username,
password: config.password
};
client.LogOn(LogOnOptions);
client.on('LoggedOn', () => {
console.log('succesfully logged on.');
});
-->
SyntaxError: C:\Users\Unistar\Desktop\Bots\Bot 1\config.json: Unexpected token } in JSON at position 63
at JSON.parse (
It would be helpful to see the content of the config.json.
{ "username":"Actual name", "password":"Actual password", }
If I understand correctly, the issue is the trailing comma: JSON does not support them.
Removed them no difference still the same problem.
Do you get exactly the same error message with this json?
{
"username":"Actual name",
"password":"Actual password"
}
I mean, only the last comma was removed, right?
now its C:\Users\Unistar\Desktop\Bots\Bot 1>node bot.js C:\Users\Unistar\Desktop\Bots\Bot 1\bot.js:10 client.LogOn(LogOnOptions); ^
TypeError: client.LogOn is not a function
at Object.
It seems this new error is better to be posted in https://github.com/DoctorMcKay/node-steam-user
A check on the defined API suggests the problem is the capitalisation of the method name. Its logOn() not LogOn().
Solved by Shellberg