当我尝试登录我的机器人时,它登录但我总是遇到同样的错误:无法生成api密钥。这段代码有什么问题?我在机器人账户上设置了api密钥。
function login(err, sessionID, cookies, steamguard) {
if(err) {
logger.error('Auth error');
logger.debug(err);
if(err.message == "SteamGuardMobile") {
account.twoFactorCode = SteamTotp.generateAuthCode(account.shared_secret);
logger.warn('Error in auth: '+account.twoFactorCode);
setTimeout(function() {
community.login(account, login);
}, 5000);
return;
}
process.exit(0);
}
logger.trace('Sucesfully auth');
account.sessionID = sessionID;
account.cookies = cookies;
community.getWebApiKey('there_is_my_vps_ip', webApiKey);
community.startConfirmationChecker(10000, account.identity_secret);
}
function webApiKey(err, key) {
if(err) {
logger.error('Cant make api key');
logger.debug(err);
process.exit(0);
return;
}
account.key = key;
logger.trace('API key bot '+account.accountName+' '+account.key);
offersSetup();
community.loggedIn(checkLoggedIn);
}
我等了2天。我尝试登录,我得到了相同的错误。
LOG
[2016-06-26 09:26:36.075] [INFO] [default] - DB connection ID: 107
[2016-06-26 09:26:36.089] [TRACE] [default] - We got account info
[2016-06-26 09:26:36.091] [DEBUG] [default] - RowDataPacket {
id: 1,
online: 0,
name: 'my_name',
steamid: 'my_steamid',
shared_secret: 'my_secret',
identity_secret: 'my_identity',
accountName: 'my_login',
password: 'my_pass',
steamguard: '',
email_login: '',
email_password: '',
twoFactorCode: 'my_2fc',
auth: true }
[2016-06-26 09:26:37.602] [TRACE] [default] - Sucesfully auth
[2016-06-26 09:26:48.531] [ERROR] [default] - Cant make apikey
[2016-06-26 09:27:00.649] [DEBUG] [default] - { Error: HTTP error 429
at SteamCommunity._checkHttpError (/var/www/Bot/node_modules/steamcommunity/components/http.js:96:9)
at Request._callback (/var/www/Bot/node_modules/steamcommunity/components/http.js:50:61)
at Request.self.callback (/var/www/Bot/node_modules/request/request.js:200:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request.<anonymous> (/var/www/Bot/node_modules/request/request.js:1067:10)
at emitOne (events.js:101:20)
at Request.emit (events.js:188:7)
at Gunzip.<anonymous> (/var/www/Bot/node_modules/request/request.js:988:12)
at emitNone (events.js:91:20) code: 429 }
答案 0 :(得分:1)
我迟到了,但我相信你的问题是你没有使用属于该机器人的api密钥。添加5美元到那个acc,然后转到www.steamcommunity.com/dev/apikey 接下来只需输入域名即可获得密钥。转到index.php并将所有api密钥替换为你的。希望这有帮助