Ejemplo n.º 1
0
        public static async Task <Log> SteamTradeJoinGiveawayAsync(Bot bot,
                                                                   SteamTrade.StGiveaway stGiveaway)
        {
            var task = new TaskCompletionSource <Log>();
            await Task.Run(() =>
            {
                var result = SteamTradeJoinGiveaway(bot, stGiveaway);
                task.SetResult(result);
            });

            return(task.Task.Result);
        }
Ejemplo n.º 2
0
 public static Log SteamTradeJoinGiveaway(Bot bot, SteamTrade.StGiveaway stGiveaway)
 {
     Thread.Sleep(requestInterval);
     stGiveaway = Parse.SteamTradeGetJoinData(stGiveaway, bot);
     if (stGiveaway.LinkJoin != null)
     {
         var response = Get("http://steamtrade.info", stGiveaway.LinkJoin, new List <Parameter>(),
                            Generate.Cookies_SteamTrade(bot),
                            new List <HttpHeader>(), bot.UserAgent);
         if (response.RestResponse.StatusCode == HttpStatusCode.OK)
         {
             return(Messages.GiveawayJoined("SteamTrade", stGiveaway.Name.Trim(), 0, 0, 0));
         }
         return(Messages.GiveawayNotJoined("SteamTrade", stGiveaway.Name,
                                           response.RestResponse.StatusCode.ToString()));
     }
     return(null);
 }