diff --git a/ASFEnhance/ASFEnhance.cs b/ASFEnhance/ASFEnhance.cs index c45acd3..2de9aa4 100644 --- a/ASFEnhance/ASFEnhance.cs +++ b/ASFEnhance/ASFEnhance.cs @@ -325,7 +325,10 @@ public Task OnLoaded() "REGISTEDATE" when access >= EAccess.Operator => Account.Command.ResponseGetRegisteDate(bot), - + + "MYBAN" when access >= EAccess.Operator => + Account.Command.ResponseGetMyBans(bot), + //Cart "CART" or "C" when access >= EAccess.Operator => @@ -624,6 +627,9 @@ public Task OnLoaded() "RL" when access >= EAccess.Master => Account.Command.ResponseRemoveFreeLicenses(bot, args[1]), + "MYBAN" when access >= EAccess.Operator => + Account.Command.ResponseGetMyBans(Utilities.GetArgsAsText(args, 1, ",")), + //Cart "CART" or "C" when access >= EAccess.Operator => diff --git a/ASFEnhance/Account/Command.cs b/ASFEnhance/Account/Command.cs index b1ee136..1d50e28 100644 --- a/ASFEnhance/Account/Command.cs +++ b/ASFEnhance/Account/Command.cs @@ -1334,6 +1334,56 @@ async Task workThread(uint subId) var responses = new List(results.Where(result => !string.IsNullOrEmpty(result))); + return responses.Count > 0 ? string.Join(Environment.NewLine, responses) : null; + } + + /// + /// 移除免费许可证 + /// + /// + /// + /// + internal static async Task ResponseGetMyBans(Bot bot) + { + if (!bot.IsConnectedAndLoggedOn) + { + return bot.FormatBotResponse(Strings.BotNotConnected); + } + + var sb = new StringBuilder(); + sb.AppendLine(bot.FormatBotResponse(Langs.MultipleLineResult)); + + var response = await WebRequest.GetMyBans(bot).ConfigureAwait(false); + sb.AppendLine(response); + + return sb.ToString(); + } + + /// + /// 移除免费许可证 (多个Bot) + /// + /// + /// + /// + /// + internal static async Task ResponseGetMyBans(string botNames) + { + if (string.IsNullOrEmpty(botNames)) + { + throw new ArgumentNullException(nameof(botNames)); + } + + var bots = Bot.GetBots(botNames); + + if ((bots == null) || (bots.Count == 0)) + { + return FormatStaticResponse(Strings.BotNotFound, botNames); + } + + var results = await Utilities.InParallel(bots.Select(ResponseGetMyBans)).ConfigureAwait(false); + + var responses = new List(results.Where(result => !string.IsNullOrEmpty(result))); + return responses.Count > 0 ? string.Join(Environment.NewLine, responses) : null; } } diff --git a/ASFEnhance/Account/WebRequest.cs b/ASFEnhance/Account/WebRequest.cs index bd6b70b..cd25aa2 100644 --- a/ASFEnhance/Account/WebRequest.cs +++ b/ASFEnhance/Account/WebRequest.cs @@ -15,29 +15,33 @@ namespace ASFEnhance.Account; internal static class WebRequest { /// - /// 加载账户历史记录 + /// 加载账户历史记录 /// /// /// /// - private static async Task AjaxLoadMoreHistory(Bot bot, AccountHistoryResponse.CursorData cursorData) + private static async Task AjaxLoadMoreHistory(Bot bot, + AccountHistoryResponse.CursorData cursorData) { var request = new Uri(SteamStoreURL, "/account/AjaxLoadMoreHistory/?l=schinese"); - var data = new Dictionary(5, StringComparer.Ordinal) { + var data = new Dictionary(5, StringComparer.Ordinal) + { { "cursor[wallet_txnid]", cursorData.WalletTxnid }, { "cursor[timestamp_newest]", cursorData.TimestampNewest.ToString() }, { "cursor[balance]", cursorData.Balance }, - { "cursor[currency]", cursorData.Currency.ToString() }, + { "cursor[currency]", cursorData.Currency.ToString() } }; - var response = await bot.ArchiWebHandler!.UrlPostToJsonObjectWithSession(request, referer: SteamStoreURL, data: data).ConfigureAwait(false); + var response = await bot.ArchiWebHandler! + .UrlPostToJsonObjectWithSession(request, referer: SteamStoreURL, data: data) + .ConfigureAwait(false); return response?.Content; } /// - /// 获取在线汇率 + /// 获取在线汇率 /// /// /// @@ -50,27 +54,28 @@ internal static class WebRequest } /// - /// 获取更多历史记录 + /// 获取更多历史记录 /// /// /// private static async Task GetAccountHistoryAjax(Bot bot) { var request = new Uri(SteamStoreURL, "/account/history?l=schinese"); - var response = await bot.ArchiWebHandler.UrlGetToHtmlDocumentWithSession(request, referer: SteamStoreURL).ConfigureAwait(false); + var response = await bot.ArchiWebHandler.UrlGetToHtmlDocumentWithSession(request, referer: SteamStoreURL) + .ConfigureAwait(false); return response; } /// - /// 获取账号消费历史记录 + /// 获取账号消费历史记录 /// /// /// internal static async Task GetAccountHistoryDetail(Bot bot) { // 读取在线汇率 - string myCurrency = bot.WalletCurrency.ToString(); - ExchangeAPIResponse? exchangeRate = await GetExchangeRatio(myCurrency).ConfigureAwait(false); + var myCurrency = bot.WalletCurrency.ToString(); + var exchangeRate = await GetExchangeRatio(myCurrency).ConfigureAwait(false); if (exchangeRate == null) { return bot.FormatBotResponse(Langs.GetExchangeRateFailed); @@ -85,9 +90,9 @@ internal static async Task GetAccountHistoryDetail(Bot bot) var result = new StringBuilder(); result.AppendLine(bot.FormatBotResponse(Langs.MultipleLineResult)); - int giftedSpend = 0; - int totalSpend = 0; - int totalExternalSpend = 0; + var giftedSpend = 0; + var totalSpend = 0; + var totalExternalSpend = 0; // 读取账户消费历史 result.AppendLine(Langs.PurchaseHistorySummary); @@ -111,7 +116,7 @@ internal static async Task GetAccountHistoryDetail(Bot bot) while (cursor != null) { - AccountHistoryResponse? ajaxHistoryResponse = await AjaxLoadMoreHistory(bot, cursor).ConfigureAwait(false); + var ajaxHistoryResponse = await AjaxLoadMoreHistory(bot, cursor).ConfigureAwait(false); if (!string.IsNullOrEmpty(ajaxHistoryResponse?.HtmlContent)) { @@ -127,14 +132,17 @@ internal static async Task GetAccountHistoryDetail(Bot bot) giftedSpend = historyData.GiftPurchase; totalSpend = historyData.StorePurchase + historyData.InGamePurchase; - totalExternalSpend = historyData.StorePurchase - historyData.StorePurchaseWallet + historyData.GiftPurchase - historyData.GiftPurchaseWallet; + totalExternalSpend = historyData.StorePurchase - historyData.StorePurchaseWallet + historyData.GiftPurchase - + historyData.GiftPurchaseWallet; result.AppendLine(Langs.PurchaseHistoryGroupType); result.AppendLineFormat(Langs.PurchaseHistoryTypeStorePurchase, historyData.StorePurchase / 100.0, symbol); - result.AppendLineFormat(Langs.PurchaseHistoryTypeExternal, (historyData.StorePurchase - historyData.StorePurchaseWallet) / 100.0, symbol); + result.AppendLineFormat(Langs.PurchaseHistoryTypeExternal, + (historyData.StorePurchase - historyData.StorePurchaseWallet) / 100.0, symbol); result.AppendLineFormat(Langs.PurchaseHistoryTypeWallet, historyData.StorePurchaseWallet / 100.0, symbol); result.AppendLineFormat(Langs.PurchaseHistoryTypeGiftPurchase, historyData.GiftPurchase / 100.0, symbol); - result.AppendLineFormat(Langs.PurchaseHistoryTypeExternal, (historyData.GiftPurchase - historyData.GiftPurchaseWallet) / 100.0, symbol); + result.AppendLineFormat(Langs.PurchaseHistoryTypeExternal, + (historyData.GiftPurchase - historyData.GiftPurchaseWallet) / 100.0, symbol); result.AppendLineFormat(Langs.PurchaseHistoryTypeWallet, historyData.GiftPurchaseWallet / 100.0, symbol); result.AppendLineFormat(Langs.PurchaseHistoryTypeInGamePurchase, historyData.InGamePurchase / 100.0, symbol); result.AppendLineFormat(Langs.PurchaseHistoryTypeMarketPurchase, historyData.MarketPurchase / 100.0, symbol); @@ -144,7 +152,8 @@ internal static async Task GetAccountHistoryDetail(Bot bot) result.AppendLineFormat(Langs.PurchaseHistoryTypeWalletPurchase, historyData.WalletPurchase / 100.0, symbol); result.AppendLineFormat(Langs.PurchaseHistoryTypeOther, historyData.Other / 100.0, symbol); result.AppendLineFormat(Langs.PurchaseHistoryTypeRefunded, historyData.RefundPurchase / 100.0, symbol); - result.AppendLineFormat(Langs.PurchaseHistoryTypeExternal, (historyData.RefundPurchase - historyData.RefundPurchaseWallet) / 100.0, symbol); + result.AppendLineFormat(Langs.PurchaseHistoryTypeExternal, + (historyData.RefundPurchase - historyData.RefundPurchaseWallet) / 100.0, symbol); result.AppendLineFormat(Langs.PurchaseHistoryTypeWallet, historyData.RefundPurchaseWallet / 100.0, symbol); result.AppendLine(Langs.PurchaseHistoryGroupStatus); @@ -153,9 +162,10 @@ internal static async Task GetAccountHistoryDetail(Bot bot) result.AppendLineFormat(Langs.PurchaseHistoryStatusTotalGift, giftedSpend / 100.0, symbol); result.AppendLine(Langs.PurchaseHistoryGroupGiftCredit); result.AppendLineFormat(Langs.PurchaseHistoryCreditMin, (totalSpend - giftedSpend) / 100, symbol); - result.AppendLineFormat(Langs.PurchaseHistoryCreditMax, (totalSpend * 1.8 - giftedSpend) / 100, symbol); + result.AppendLineFormat(Langs.PurchaseHistoryCreditMax, ((totalSpend * 1.8) - giftedSpend) / 100, symbol); result.AppendLineFormat(Langs.PurchaseHistoryExternalMin, (totalExternalSpend - giftedSpend) / 100, symbol); - result.AppendLineFormat(Langs.PurchaseHistoryExternalMax, (totalExternalSpend * 1.8 - giftedSpend) / 100, symbol); + result.AppendLineFormat(Langs.PurchaseHistoryExternalMax, ((totalExternalSpend * 1.8) - giftedSpend) / 100, + symbol); var updateTime = DateTimeOffset.FromUnixTimeSeconds(exchangeRate.UpdateTime).UtcDateTime; @@ -169,19 +179,20 @@ internal static async Task GetAccountHistoryDetail(Bot bot) } /// - /// 获取许可证信息 + /// 获取许可证信息 /// /// /// internal static async Task?> GetOwnedLicenses(Bot bot) { var request = new Uri(SteamStoreURL, "/account/licenses/?l=schinese"); - var response = await bot.ArchiWebHandler.UrlGetToHtmlDocumentWithSession(request, referer: SteamStoreURL).ConfigureAwait(false); + var response = await bot.ArchiWebHandler.UrlGetToHtmlDocumentWithSession(request, referer: SteamStoreURL) + .ConfigureAwait(false); return HtmlParser.ParseLincensesPage(response); } /// - /// 移除许可证 + /// 移除许可证 /// /// /// @@ -191,28 +202,28 @@ internal static async Task RemoveLicense(Bot bot, uint subId) var request = new Uri(SteamStoreURL, "/account/removelicense"); var referer = new Uri(SteamStoreURL, "/account/licenses/"); - var data = new Dictionary(2) { - { "packageid", subId.ToString() }, - }; + var data = new Dictionary(2) { { "packageid", subId.ToString() } }; - var response = await bot.ArchiWebHandler.UrlPostToHtmlDocumentWithSession(request, data: data, referer: referer).ConfigureAwait(false); + var response = await bot.ArchiWebHandler.UrlPostToHtmlDocumentWithSession(request, data: data, referer: referer) + .ConfigureAwait(false); return response?.StatusCode == HttpStatusCode.OK; } /// - /// 获取邮箱通知偏好 + /// 获取邮箱通知偏好 /// /// /// internal static async Task GetAccountEmailOptions(Bot bot) { var request = new Uri(SteamStoreURL, "/account/emailoptout"); - var response = await bot.ArchiWebHandler.UrlGetToHtmlDocumentWithSession(request, referer: SteamStoreURL).ConfigureAwait(false); + var response = await bot.ArchiWebHandler.UrlGetToHtmlDocumentWithSession(request, referer: SteamStoreURL) + .ConfigureAwait(false); return HtmlParser.ParseEmailOptionPage(response); } /// - /// 设置邮箱通知偏好 + /// 设置邮箱通知偏好 /// /// /// @@ -221,9 +232,9 @@ internal static async Task RemoveLicense(Bot bot, uint subId) { var request = new Uri(SteamStoreURL, "/account/emailoptout"); - var data = new Dictionary(11) { - { "action", "save" }, - { "opt_out_all",option.EnableEmailNotification ? "0" : "1" }, + var data = new Dictionary(11) + { + { "action", "save" }, { "opt_out_all", option.EnableEmailNotification ? "0" : "1" } }; if (option.EnableEmailNotification) @@ -232,55 +243,64 @@ internal static async Task RemoveLicense(Bot bot, uint subId) { data.Add("opt_out_wishlist_inverse", "on"); } + if (option.WhenWishlistRelease) { data.Add("opt_out_wishlist_releases_inverse", "on"); } + if (option.WhenGreenLightRelease) { data.Add("opt_out_greenlight_releases_inverse", "on"); } + if (option.WhenFollowPublisherRelease) { data.Add("opt_out_creator_home_releases_inverse", "on"); } + if (option.WhenSaleEvent) { data.Add("opt_out_seasonal_inverse", "on"); } + if (option.WhenReceiveCuratorReview) { data.Add("opt_out_curator_connect_inverse", "on"); } + if (option.WhenReceiveCommunityReward) { data.Add("opt_out_loyalty_awards_inverse", "on"); } + if (option.WhenGameEventNotification) { data.Add("opt_out_in_library_events_inverse", "on"); } } - var response = await bot.ArchiWebHandler.UrlPostToHtmlDocumentWithSession(request, referer: SteamStoreURL, data: data).ConfigureAwait(false); + var response = await bot.ArchiWebHandler + .UrlPostToHtmlDocumentWithSession(request, referer: SteamStoreURL, data: data).ConfigureAwait(false); return HtmlParser.ParseEmailOptionPage(response); } /// - /// 获取通知偏好 + /// 获取通知偏好 /// /// /// internal static async Task GetAccountNotificationOptions(Bot bot) { var request = new Uri(SteamStoreURL, "/account/notificationsettings"); - var response = await bot.ArchiWebHandler.UrlGetToHtmlDocumentWithSession(request, referer: SteamStoreURL).ConfigureAwait(false); + var response = await bot.ArchiWebHandler.UrlGetToHtmlDocumentWithSession(request, referer: SteamStoreURL) + .ConfigureAwait(false); return HtmlParser.ParseNotificationOptionPage(response); } /// - /// 设置通知偏好 + /// 设置通知偏好 /// /// /// @@ -292,27 +312,27 @@ internal static async Task RemoveLicense(Bot bot, uint subId) var optionList = new List { new(ENotificationType.ReceivedGift, option.ReceivedGift), - new(ENotificationType.SubscribedDissionReplyed,option.SubscribedDissionReplyed), - new(ENotificationType.ReceivedNewItem,option.ReceivedNewItem), - new(ENotificationType.MajorSaleStart,option.MajorSaleStart), - new(ENotificationType.ItemInWishlistOnSale,option.ItemInWishlistOnSale), - new(ENotificationType.ReceivedTradeOffer,option.ReceivedTradeOffer), - new(ENotificationType.ReceivedSteamSupportReply,option.ReceivedSteamSupportReply), - new(ENotificationType.SteamTurnNotification,option.SteamTurnNotification), + new(ENotificationType.SubscribedDissionReplyed, option.SubscribedDissionReplyed), + new(ENotificationType.ReceivedNewItem, option.ReceivedNewItem), + new(ENotificationType.MajorSaleStart, option.MajorSaleStart), + new(ENotificationType.ItemInWishlistOnSale, option.ItemInWishlistOnSale), + new(ENotificationType.ReceivedTradeOffer, option.ReceivedTradeOffer), + new(ENotificationType.ReceivedSteamSupportReply, option.ReceivedSteamSupportReply), + new(ENotificationType.SteamTurnNotification, option.SteamTurnNotification) }; var json = optionList.ToJsonText(); - var data = new Dictionary(11) { - { "notificationpreferences", json }, - }; + var data = new Dictionary(11) { { "notificationpreferences", json } }; - var response = await bot.ArchiWebHandler.UrlPostToJsonObjectWithSession(request, referer: SteamStoreURL, data: data).ConfigureAwait(false); + var response = await bot.ArchiWebHandler + .UrlPostToJsonObjectWithSession(request, referer: SteamStoreURL, data: data) + .ConfigureAwait(false); return response?.Content; } /// - /// 获取用户封禁状态 + /// 获取用户封禁状态 /// /// /// @@ -321,20 +341,23 @@ internal static async Task RemoveLicense(Bot bot, uint subId) internal static async Task GetPlayerBans(Bot bot, string token, ulong steamids) { var request = new Uri(SteamApiURL, $"/ISteamUser/GetPlayerBans/v1/?key={token}&steamids={steamids}"); - var response = await bot.ArchiWebHandler.UrlGetToJsonObjectWithSession(request, referer: SteamStoreURL).ConfigureAwait(false); + var response = await bot.ArchiWebHandler + .UrlGetToJsonObjectWithSession(request, referer: SteamStoreURL) + .ConfigureAwait(false); return response?.Content; } internal static async Task GetAccountBans(Bot bot) { var request = new Uri(SteamCommunityURL, $"/profiles/{bot.SteamID}/currentbans"); - var response = await bot.ArchiWebHandler.UrlGetToHtmlDocumentWithSession(request, referer: SteamStoreURL).ConfigureAwait(false); + var response = await bot.ArchiWebHandler.UrlGetToHtmlDocumentWithSession(request, referer: SteamStoreURL) + .ConfigureAwait(false); return HtmlParser.ParseAccountBans(response?.Content); } /// - /// 获取礼物Id + /// 获取礼物Id /// /// /// @@ -348,7 +371,7 @@ internal static async Task RemoveLicense(Bot bot, uint subId) } /// - /// 接收礼物 + /// 接收礼物 /// /// /// @@ -357,21 +380,25 @@ internal static async Task RemoveLicense(Bot bot, uint subId) { var request = new Uri(SteamStoreURL, $"/gifts/{giftId}/unpack"); - var response = await bot.ArchiWebHandler.UrlPostToJsonObjectWithSession(request, null, null).ConfigureAwait(false); + var response = await bot.ArchiWebHandler.UrlPostToJsonObjectWithSession(request, null, null) + .ConfigureAwait(false); return response?.Content; } /// - /// 获取游戏游玩时间 + /// 获取游戏游玩时间 /// /// /// /// internal static async Task?> GetGamePlayTime(Bot bot, string token) { - var request = new Uri(SteamApiURL, $"/IPlayerService/GetOwnedGames/v1/?access_token={token}&steamid={bot.SteamID}&include_appinfo=true&include_played_free_games=true&include_free_sub=true&skip_unvetted_apps=true&language={DefaultOrCurrentLanguage}&include_extended_appinfo=true"); - var response = await bot.ArchiWebHandler.UrlGetToJsonObjectWithSession(request, referer: SteamStoreURL).ConfigureAwait(false); + var request = new Uri(SteamApiURL, + $"/IPlayerService/GetOwnedGames/v1/?access_token={token}&steamid={bot.SteamID}&include_appinfo=true&include_played_free_games=true&include_free_sub=true&skip_unvetted_apps=true&language={DefaultOrCurrentLanguage}&include_extended_appinfo=true"); + var response = await bot.ArchiWebHandler + .UrlGetToJsonObjectWithSession(request, referer: SteamStoreURL) + .ConfigureAwait(false); if (response?.Content?.Response?.Games != null) { @@ -384,33 +411,33 @@ internal static async Task RemoveLicense(Bot bot, uint subId) return result; } - else - { - return null; - } + + return null; } /// - /// 获取账号邮箱 + /// 获取账号邮箱 /// /// /// internal static async Task GetAccountEmail(Bot bot) { var request = new Uri(SteamStoreURL, "/account"); - var response = await bot.ArchiWebHandler.UrlGetToHtmlDocumentWithSession(request, referer: SteamStoreURL).ConfigureAwait(false); + var response = await bot.ArchiWebHandler.UrlGetToHtmlDocumentWithSession(request, referer: SteamStoreURL) + .ConfigureAwait(false); return HtmlParser.ParseAccountEmail(response?.Content); } /// - /// 检查是否存在ApiKey + /// 检查是否存在ApiKey /// /// /// internal static async Task CheckApiKey(Bot bot) { var request = new Uri(SteamCommunityURL, "/dev/apikey"); - var response = await bot.ArchiWebHandler.UrlGetToHtmlDocumentWithSession(request, referer: SteamStoreURL).ConfigureAwait(false); + var response = await bot.ArchiWebHandler.UrlGetToHtmlDocumentWithSession(request, referer: SteamStoreURL) + .ConfigureAwait(false); if (response?.Content == null) { @@ -421,7 +448,7 @@ internal static async Task RemoveLicense(Bot bot, uint subId) } /// - /// 注销APIKey + /// 注销APIKey /// /// /// @@ -429,16 +456,13 @@ internal static async Task RevokeApiKey(Bot bot) { var request = new Uri(SteamCommunityURL, "/dev/revokekey"); - var data = new Dictionary(2) - { - { "Revoke", "Revoke+My+Steam+Web+API+Key" }, - }; + var data = new Dictionary(2) { { "Revoke", "Revoke+My+Steam+Web+API+Key" } }; await bot.ArchiWebHandler.UrlPostWithSession(request, data: data).ConfigureAwait(false); } /// - /// 获取私密应用列表 + /// 获取私密应用列表 /// /// /// @@ -448,13 +472,14 @@ internal static async Task RevokeApiKey(Bot bot) var token = bot.AccessToken ?? throw new AccessTokenNullException(); var request = new Uri(SteamApiURL, $"/IAccountPrivateAppsService/GetPrivateAppList/v1/?access_token={token}"); - var response = await bot.ArchiWebHandler.UrlGetToJsonObjectWithSession>(request).ConfigureAwait(false); + var response = await bot.ArchiWebHandler + .UrlGetToJsonObjectWithSession>(request).ConfigureAwait(false); return response?.Content?.Response; } /// - /// 设置私密应用 + /// 设置私密应用 /// /// /// @@ -468,21 +493,21 @@ internal static async Task ToggleAppPrivacy(Bot bot, List appIds, bo var data = new Dictionary(2) { { "access_token", bot.AccessToken ?? throw new AccessTokenNullException() }, - { "private", isPrivate ? "true" : "false" }, + { "private", isPrivate ? "true" : "false" } }; - int i = 0; + var i = 0; foreach (var appId in appIds) { data.Add($"appids[{i++}]", appId.ToString()); } - var response = await bot.ArchiWebHandler.UrlPost(request, data: data).ConfigureAwait(false); + var response = await bot.ArchiWebHandler.UrlPost(request, data).ConfigureAwait(false); return response; } /// - /// 获取市场是否受限 + /// 获取市场是否受限 /// /// /// @@ -501,14 +526,12 @@ internal static async Task ToggleAppPrivacy(Bot bot, List appIds, bo { return true; } - else - { - return false; - } + + return false; } /// - /// 获取电话号码后缀 + /// 获取电话号码后缀 /// /// /// @@ -526,7 +549,7 @@ internal static async Task ToggleAppPrivacy(Bot bot, List appIds, bo } /// - /// 获取注册时间 + /// 获取注册时间 /// /// /// @@ -542,4 +565,31 @@ internal static async Task ToggleAppPrivacy(Bot bot, List appIds, bo return response.Content.QuerySelector("div.badge_description")?.TextContent?.Trim(); } -} + + internal static async Task GetMyBans(Bot bot) + { + var request = new Uri(SteamHelpURL, "/wizard/VacBans"); + var response = await bot.ArchiWebHandler.UrlGetToHtmlDocumentWithSession(request).ConfigureAwait(false); + + if (response?.Content == null) + { + return null; + } + + + var bans = response.Content.QuerySelectorAll("div.refund_info_box>div>span"); + + if (bans.Length == 0) + { + return "未收到封禁"; + } + + var sb = new StringBuilder(); + foreach (var ban in bans) + { + sb.AppendLine(ban.TextContent.Trim()); + } + + return sb.ToString(); + } +} \ No newline at end of file diff --git a/ASFEnhance/Utils.cs b/ASFEnhance/Utils.cs index e008ea5..7dbdb5f 100644 --- a/ASFEnhance/Utils.cs +++ b/ASFEnhance/Utils.cs @@ -236,6 +236,8 @@ internal static void BypassAgeCheck(this ArchiWebHandler webHandler) /// internal static Uri SteamCheckoutURL => ArchiWebHandler.SteamCheckoutURL; + internal static Uri SteamHelpURL => ArchiWebHandler.SteamHelpURL; + /// /// 日志 ///