C#我怎样才能接受蒸汽蒸汽报价?

时间:2015-10-20 00:29:56

标签: c# steam steam-web-api trading

我已经检查了SteamBot的来源,但由于我是一名新的编码器,我似乎不太了解它。如果有人可以帮助我,那就太好了!提前谢谢。

我在SteamBot上找到了一种方法(https://github.com/Jessecar96/SteamBot/blob/master/SteamTrade/TradeOffer/OfferSession.cs#L30

但我似乎并不理解。

这可能会有所帮助(https://www.reddit.com/r/SteamBot/comments/3a6rp6/who_to_accept_traiding_offers_with_c_steam/.compact

1 个答案:

答案 0 :(得分:1)

在您的代码中,您需要引用类

//at the top of the file
using SteamTrade.TradeOffer;

//the later on in the file
Offersession newSteamSession = new OfferSession('yourApiKey', 'steamweb');

string convertedStringtradeId = String.Empty;
var isAccepted = newSteamSession.Accept(tradeOfferId, convertedStringtradeId);

if(isAccepted) 
{
    //do more logic here if the offer was good
    //you can use the convertedStringtradeId if you need something


}else
{
  //what happens when things go wrong
}