Steam用户部分有什么错误?

时间:2019-05-10 16:42:36

标签: node.js

Steam用户部分有什么错误?

Steam Guard App Code: 8rygp
Logged in!
/root/deneme.js:13
    user.setPersona(User.Steam.EPersonaState.Online) // Set to offline or online
 - your choice.^



ReferenceError: User is not defined
    at SteamUser.<anonymous> (/root/deneme.js:13:21)
    at SteamUser.emit (events.js:189:13)
    at _apiRequest (/root/node_modules/steam-user/components/web.js:61:9)
    at IncomingMessage.<anonymous> (/root/node_modules/steam-user/components/webapi.js:82:4)
    at IncomingMessage.emit (events.js:194:15)
    at endReadableNT (_stream_readable.js:1103:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
root@IP:~# node deneme.js
Steam Guard App Code: wqxk3
Logged in!
/root/deneme.js:13
    user.setPersona(SteamUser.Steam.EPersonaState.Online) // Set to offline or online - your choice.
                                    ^

TypeError: Cannot read property 'EPersonaState' of undefined
    at SteamUser.<anonymous> (/root/deneme.js:13:37)
    at SteamUser.emit (events.js:189:13)
    at _apiRequest (/root/node_modules/steam-user/components/web.js:61:9)
    at IncomingMessage.<anonymous> (/root/node_modules/steam-user/components/webapi.js:82:4)
    at IncomingMessage.emit (events.js:194:15)
    at endReadableNT (_stream_readable.js:1103:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

我在ubuntu服务器上运行了它; 节点deneme.js

var SteamUser = require('steam-user');
var SteamTotp = require('steam-totp');
var user = new SteamUser();

user.logOn({
    accountName: "Nickname",
    password: "password",
    oneFactorCode: SteamTotp.getAuthCode("")
});

user.on('webSession', function() {
    console.log('Logged in!');
    user.setPersona(SteamUser.Steam.EPersonaState.Online) // Set to offline or online - your choice.
    user.gamesPlayed([730,48700,359550]); // Enter ID of the steam game. Found in the store link (/app/10) is Counter-Strike

});

请求蒸汽防护后,仅需写入登录! 但他替换了上面显示的错误

0 个答案:

没有答案