-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
39 lines (38 loc) · 1.01 KB
/
Copy pathindex.js
File metadata and controls
39 lines (38 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
const Steam = require('steam');
/**
* Options demo data for login steam
* @type {{password: string, account_name: string}}
*/
const logOnOptions = {
account_name: "uehsgadpnu02s14",
password: 'IDPFP049P85L780'
};
const steamClient = new Steam.SteamClient();
const steamUser = new Steam.SteamUser(steamClient);
steamClient.connect();
steamClient.on('connected', () => {
steamUser.logOn(logOnOptions);
});
steamClient.on('logOnResponse', (logonResp) => {
checkerErrorLogin(logonResp).then((res) => {
console.log(res)
}).catch((e) => {
console.log(e)
})
});
steamClient.on('error', (err) => {
console.log(err)
});
function checkerErrorLogin(payload) {
return new Promise(((resolve, reject) => {
const code = payload['eresult']
if (code === 63) {
reject('Account with 2FA email')
} else if (code === 85) {
reject('Account with steam guard')
} else if (code === 5) {
reject('ERROR')
}
resolve(payload)
}))
}