Skip to content

Commit

Permalink
修复 DELETERECOMMENT 命令无法工作的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chr233 committed Jun 8, 2022
1 parent 665e00e commit 424ff5c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ASFEnhance/Store/WebRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ internal static class WebRequest
internal static async Task<RecommendGameResponse?> PublishReview(Bot bot, uint gameID, string comment, bool rateUp = true, bool isPublic = true, bool enComment = true, bool forFree = false)
{
Uri request = new(SteamStoreURL, "/friends/recommendgame");
Uri referer = new(SteamStoreURL, $"/app/{gameID}");

string? language = bot.ArchiWebHandler.WebBrowser.CookieContainer.GetCookieValue(SteamStoreURL, "Steam_Language") ?? "english";

Expand All @@ -95,7 +96,7 @@ internal static class WebRequest
//{ "sessionid", "" },
};

ObjectResponse<RecommendGameResponse>? response = await bot.ArchiWebHandler.UrlPostToJsonObjectWithSession<RecommendGameResponse>(request, data: data, referer: SteamStoreURL).ConfigureAwait(false);
ObjectResponse<RecommendGameResponse>? response = await bot.ArchiWebHandler.UrlPostToJsonObjectWithSession<RecommendGameResponse>(request, data: data, referer: referer).ConfigureAwait(false);

return response?.Content;
}
Expand All @@ -108,7 +109,8 @@ internal static class WebRequest
/// <returns></returns>
internal static async Task<bool> DeleteRecommend(Bot bot, uint gameID)
{
Uri request = new(SteamStoreURL, $"/profiles/{bot.SteamID}/recommended/");
Uri request = new(SteamCommunityURL, $"/profiles/{bot.SteamID}/recommended/");
Uri referer = new(request, $"/{gameID}/");

Dictionary<string, string> data = new(3, StringComparer.Ordinal)
{
Expand All @@ -117,7 +119,7 @@ internal static async Task<bool> DeleteRecommend(Bot bot, uint gameID)
{ "appid", gameID.ToString() },
};

await bot.ArchiWebHandler.UrlPostWithSession(request, data: data, referer: SteamCommunityURL).ConfigureAwait(false);
await bot.ArchiWebHandler.UrlPostWithSession(request, data: data, referer: referer).ConfigureAwait(false);

return true;
}
Expand Down Expand Up @@ -291,7 +293,7 @@ internal static async Task<bool> DeleteRecommend(Bot bot, uint gameID)

result.AppendLine(Langs.PruchaseHistoryGroupAbout);
result.AppendLine(string.Format(Langs.PruchaseHistoryAboutBaseRate, exchangeRate.Base));
result.AppendLine(string.Format(Langs.PruchaseHistoryAboutPlugin, nameof(ASFEnhance)));
result.AppendLine(string.Format(Langs.PruchaseHistoryAboutPlugin, nameof(ASFEnhanceEx)));
result.AppendLine(string.Format(Langs.PruchaseHistoryAboutUpdateTime, updateTime));
result.AppendLine(string.Format(Langs.PruchaseHistoryAboutRateSource));

Expand Down

0 comments on commit 424ff5c

Please sign in to comment.