简体   繁体   English

节点JS Steam-Tradeoffer-Manager

[英]Node JS steam-tradeoffer-manager

I'm working on a SteamTradeBot but I have a problem with getOffer() . 我正在使用SteamTradeBot,但是我对getOffer()有问题。

manager.getOffer(trade_id[i],function(offer){...});

My goal is to output the ID and accept the tradeoffer but it doesn't work because offer is set to null. 我的目标是输出ID并接受折衷方案,但是由于offer设置为null,所以它不起作用。

console.log(offer.id);
                  ^
TypeError: Cannot read property 'id' of null

Is there any way to fix it? 有什么办法可以解决?

您缺少“错误”回调:

manager.getOffer(trade_id[i],function(err, offer){...});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM