From 18b0287b92d7dd98207ccfe84aa40a1d4954842d Mon Sep 17 00:00:00 2001 From: chr_ Date: Thu, 15 Aug 2024 13:33:40 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E6=96=B0=E5=A2=9E=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ASFEnhance/ASFEnhance.cs | 10 +- ASFEnhance/ASFEnhance.csproj | 2 +- ASFEnhance/Account/HtmlParser.cs | 18 +- ASFEnhance/Account/WebRequest.cs | 16 +- ASFEnhance/Community/Command.cs | 109 +++++++++++- ASFEnhance/Community/WebRequest.cs | 26 +-- ASFEnhance/Data/CuratorItem.cs | 8 +- ASFEnhance/Data/ENotificationType.cs | 48 ++++++ .../GetSteamNotificationsResponse.cs | 60 +++++++ ASFEnhance/Data/NotificationOptions.cs | 47 +---- ASFEnhance/Localization/Langs.Designer.cs | 162 ++++++++++++++++++ ASFEnhance/Localization/Langs.resx | 54 ++++++ ASFEnhance/Utils.cs | 12 +- Directory.Build.props | 2 +- 14 files changed, 491 insertions(+), 83 deletions(-) create mode 100644 ASFEnhance/Data/ENotificationType.cs create mode 100644 ASFEnhance/Data/ISteamNotificationService/GetSteamNotificationsResponse.cs diff --git a/ASFEnhance/ASFEnhance.cs b/ASFEnhance/ASFEnhance.cs index 57b95f89..4dd1beda 100644 --- a/ASFEnhance/ASFEnhance.cs +++ b/ASFEnhance/ASFEnhance.cs @@ -353,6 +353,10 @@ public Task OnLoaded() Cart.Command.ResponsePurchaseSelf(bot), //Community + "NOTIFICATION" or + "N" when access >= EAccess.Operator => + Community.Command.ResponseGetNotifications(bot), + "CLEARNOTIFICATION" or "CN" when access >= EAccess.Operator => Community.Command.ResponseClearNotification(bot), @@ -693,6 +697,10 @@ public Task OnLoaded() Cart.Command.ResponsePurchaseSelf(Utilities.GetArgsAsText(args, 1, ",")), //Community + "NOTIFICATION" or + "N" when access >= EAccess.Operator => + Community.Command.ResponseGetNotifications(Utilities.GetArgsAsText(args, 1, ",")), + "CLEARNOTIFICATION" or "CN" when access >= EAccess.Operator => Community.Command.ResponseClearNotification(Utilities.GetArgsAsText(args, 1, ",")), @@ -1169,7 +1177,7 @@ public Task OnLoaded() if (!string.IsNullOrEmpty(Config.ApiKey)) { - cfg = cfg.Replace(Config.ApiKey, "null"); + cfg = cfg.Replace(Config.ApiKey, "**hidden**"); } var sb = new StringBuilder(); diff --git a/ASFEnhance/ASFEnhance.csproj b/ASFEnhance/ASFEnhance.csproj index 7413076e..4799e810 100644 --- a/ASFEnhance/ASFEnhance.csproj +++ b/ASFEnhance/ASFEnhance.csproj @@ -1,4 +1,4 @@ - + Library diff --git a/ASFEnhance/Account/HtmlParser.cs b/ASFEnhance/Account/HtmlParser.cs index f65c56e0..4ba5485d 100644 --- a/ASFEnhance/Account/HtmlParser.cs +++ b/ASFEnhance/Account/HtmlParser.cs @@ -436,31 +436,31 @@ decimal ParseMoneyString(string strMoney) { switch (option.NotificationType) { - case NotificationType.ReceivedGift: + case ENotificationType.ReceivedGift: result.ReceivedGift = option.NotificationTargets; break; - case NotificationType.SubscribedDissionReplyed: + case ENotificationType.SubscribedDissionReplyed: result.SubscribedDissionReplyed = option.NotificationTargets; break; - case NotificationType.ReceivedNewItem: + case ENotificationType.ReceivedNewItem: result.ReceivedNewItem = option.NotificationTargets; break; - case NotificationType.ReceivedFriendInvitation: + case ENotificationType.ReceivedFriendInvitation: result.ReceivedFriendInvitation = option.NotificationTargets; break; - case NotificationType.MajorSaleStart: + case ENotificationType.MajorSaleStart: result.MajorSaleStart = option.NotificationTargets; break; - case NotificationType.ItemInWishlistOnSale: + case ENotificationType.ItemInWishlistOnSale: result.ItemInWishlistOnSale = option.NotificationTargets; break; - case NotificationType.ReceivedTradeOffer: + case ENotificationType.ReceivedTradeOffer: result.ReceivedTradeOffer = option.NotificationTargets; break; - case NotificationType.ReceivedSteamSupportReply: + case ENotificationType.ReceivedSteamSupportReply: result.ReceivedSteamSupportReply = option.NotificationTargets; break; - case NotificationType.SteamTurnNotification: + case ENotificationType.SteamTurnNotification: result.SteamTurnNotification = option.NotificationTargets; break; } diff --git a/ASFEnhance/Account/WebRequest.cs b/ASFEnhance/Account/WebRequest.cs index eee4d747..9b12e23d 100644 --- a/ASFEnhance/Account/WebRequest.cs +++ b/ASFEnhance/Account/WebRequest.cs @@ -291,14 +291,14 @@ internal static async Task RemoveLicense(Bot bot, uint subId) var optionList = new List { - new(NotificationType.ReceivedGift, option.ReceivedGift), - new(NotificationType.SubscribedDissionReplyed,option.SubscribedDissionReplyed), - new(NotificationType.ReceivedNewItem,option.ReceivedNewItem), - new(NotificationType.MajorSaleStart,option.MajorSaleStart), - new(NotificationType.ItemInWishlistOnSale,option.ItemInWishlistOnSale), - new(NotificationType.ReceivedTradeOffer,option.ReceivedTradeOffer), - new(NotificationType.ReceivedSteamSupportReply,option.ReceivedSteamSupportReply), - new(NotificationType.SteamTurnNotification,option.SteamTurnNotification), + 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), }; var json = optionList.ToJsonText(); diff --git a/ASFEnhance/Community/Command.cs b/ASFEnhance/Community/Command.cs index ae5f9ebd..646099c4 100644 --- a/ASFEnhance/Community/Command.cs +++ b/ASFEnhance/Community/Command.cs @@ -1,12 +1,119 @@ using ArchiSteamFarm.Core; using ArchiSteamFarm.Localization; using ArchiSteamFarm.Steam; +using ASFEnhance.Data; +using System.Text; namespace ASFEnhance.Community; internal static class Command { + /// + /// 清除通知小绿信 + /// + /// + /// + internal static async Task ResponseGetNotifications(Bot bot) + { + if (!bot.IsConnectedAndLoggedOn) + { + return bot.FormatBotResponse(Strings.BotNotConnected); + } + + var result = await WebRequest.GetSteamNotificationsResponse(bot).ConfigureAwait(false); + var response = result?.Response; + + if (response?.Notifications == null) + { + return bot.FormatBotResponse(Langs.NetworkError); + } + + var sb = new StringBuilder(); + sb.AppendLine(Langs.MultipleLineResult); + + int index = 1; + foreach (var notification in response.Notifications) + { + var type = notification.NotificationType switch + { + (int)ENotificationType.ReceivedGift => Langs.MsgReceivedGift, + (int)ENotificationType.SubscribedDissionReplyed => Langs.MsgReceivedReplyed, + (int)ENotificationType.ReceivedNewItem => Langs.MsgReceivedNewItem, + (int)ENotificationType.ReceivedFriendInvitation => Langs.MsgFriendInviation, + (int)ENotificationType.MajorSaleStart => Langs.MsgMajorSale, + (int)ENotificationType.ItemInWishlistOnSale => Langs.MsgWishlistItemOnSale, + (int)ENotificationType.ReceivedTradeOffer => Langs.MsgTradeOffer, + (int)ENotificationType.ReceivedSteamSupportReply => Langs.MsgSteamSupport, + (int)ENotificationType.SteamTurnNotification => Langs.MsgSteamTurn, + (int)ENotificationType.SteamCommunityMessage => Langs.MsgCommunityMessage, + _ => notification.NotificationType.ToString(), + }; + + sb.AppendLineFormat("{0}{1}: {2} {3}", notification.Read ? "" : "*", index++, type, notification.BodyData); + + if (index >= 15) + { + break; + } + } + + if (index == 1) + { + sb.AppendLine(Langs.MsgNoMessage); + } + + sb.AppendLine(Static.Line); + sb.AppendLineFormat(Langs.NocUnreadCount, response.UnreadCount); + + if (response.ConfirmationCount > 0) + { + sb.AppendLineFormat(Langs.NocConfirmationCount, response.ConfirmationCount); + } + if (response.PendingGiftCount > 0) + { + sb.AppendLineFormat(Langs.NocPendingGiftCount, response.PendingGiftCount); + } + if (response.PendingFriendCount > 0) + { + sb.AppendLineFormat(Langs.NocPendingFriendCount, response.PendingFriendCount); + } + if (response.PendingFamilyInviteCount > 0) + { + sb.AppendLineFormat(Langs.NocPendingFamilyInviteCount, response.PendingFamilyInviteCount); + } + + return bot.FormatBotResponse(sb.ToString()); + } + + /// + /// 清除通知小绿信 (多个Bot) + /// + /// + /// + /// + internal static async Task ResponseGetNotifications(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(bot => ResponseGetNotifications(bot))).ConfigureAwait(false); + + var responses = new List(results.Where(result => !string.IsNullOrEmpty(result))); + + return responses.Count > 0 ? string.Join(Environment.NewLine, responses) : null; + } + + /// /// 清除通知小绿信 /// @@ -19,7 +126,7 @@ internal static class Command return bot.FormatBotResponse(Strings.BotNotConnected); } - var result = await WebRequest.PureCommentNotifications(bot).ConfigureAwait(false); + var result = await WebRequest.MarkNotificationsRead(bot).ConfigureAwait(false); return bot.FormatBotResponse(result ? Langs.Success : Langs.Failure); } diff --git a/ASFEnhance/Community/WebRequest.cs b/ASFEnhance/Community/WebRequest.cs index a78fcd14..60159942 100644 --- a/ASFEnhance/Community/WebRequest.cs +++ b/ASFEnhance/Community/WebRequest.cs @@ -1,4 +1,5 @@ using ArchiSteamFarm.Steam; +using ASFEnhance.Data.ISteamNotificationService; namespace ASFEnhance.Community; @@ -9,23 +10,28 @@ internal static class WebRequest /// /// /// - internal static async Task PureCommentNotifications(Bot bot) + internal static async Task MarkNotificationsRead(Bot bot) { - var token = bot.AccessToken; - if (token == null) - { - return false; - } - var request = new Uri(SteamApiURL, "/ISteamNotificationService/MarkNotificationsRead/v1/"); - var data = new Dictionary(2) { - { "access_token", token }, + { "access_token", bot.AccessToken ?? throw new AccessTokenNullException() }, + { "timestamp", "0" }, { "mark_all_read", "true" }, }; - await bot.ArchiWebHandler.UrlPostWithSession(request, data: data, referer: SteamCommunityURL).ConfigureAwait(false); + await bot.ArchiWebHandler.UrlPost(request, data: data, referer: SteamCommunityURL).ConfigureAwait(false); return true; } + + internal static async Task GetSteamNotificationsResponse(Bot bot) + { + var token = bot.AccessToken ?? throw new AccessTokenNullException(); + + var request = new Uri(SteamApiURL, $"/ISteamNotificationService/GetSteamNotifications/v1/?access_token={token}&include_hidden=true&language={Langs.Language}&include_confirmation_count=true&include_pinned_counts=true&include_read=true"); + + var response = await bot.ArchiWebHandler.UrlGetToJsonObjectWithSession(request, referer: SteamCommunityURL).ConfigureAwait(false); + + return response?.Content; + } } diff --git a/ASFEnhance/Data/CuratorItem.cs b/ASFEnhance/Data/CuratorItem.cs index 416cfff1..d84f4b89 100644 --- a/ASFEnhance/Data/CuratorItem.cs +++ b/ASFEnhance/Data/CuratorItem.cs @@ -11,19 +11,19 @@ public sealed record CuratorItem /// 名称 /// [JsonPropertyName("name")] - public string Name { get; set; } = ""; + public string? Name { get; set; } /// /// 描述 /// [JsonPropertyName("curator_description")] - public string Description { get; set; } = ""; + public string? Description { get; set; } /// /// ID /// - [JsonPropertyName("clanId")] - public string ClanId { get; set; } = ""; + [JsonPropertyName("clanID")] + public string? ClanId { get; set; } /// /// 关注人数 diff --git a/ASFEnhance/Data/ENotificationType.cs b/ASFEnhance/Data/ENotificationType.cs new file mode 100644 index 00000000..675b0577 --- /dev/null +++ b/ASFEnhance/Data/ENotificationType.cs @@ -0,0 +1,48 @@ +namespace ASFEnhance.Data; + +/// +/// 通知类型 +/// +internal enum ENotificationType : byte +{ + /// + /// 收到礼物 + /// + ReceivedGift = 2, + /// + /// 订阅的讨论回复 + /// + SubscribedDissionReplyed, + /// + /// 有新物品 + /// + ReceivedNewItem, + /// + /// 收到好友邀请 + /// + ReceivedFriendInvitation, + /// + /// 大促开始 + /// + MajorSaleStart, + /// + /// 愿望单物品打折 + /// + ItemInWishlistOnSale = 8, + /// + /// 收到交易报价 + /// + ReceivedTradeOffer, + /// + /// 收到客服回复 + /// + ReceivedSteamSupportReply = 11, + /// + /// Steam回合通知 + /// + SteamTurnNotification, + /// + /// Steam消息 + /// + SteamCommunityMessage = 14, +} diff --git a/ASFEnhance/Data/ISteamNotificationService/GetSteamNotificationsResponse.cs b/ASFEnhance/Data/ISteamNotificationService/GetSteamNotificationsResponse.cs new file mode 100644 index 00000000..e7236320 --- /dev/null +++ b/ASFEnhance/Data/ISteamNotificationService/GetSteamNotificationsResponse.cs @@ -0,0 +1,60 @@ +using System.Text.Json.Serialization; + +namespace ASFEnhance.Data.ISteamNotificationService; + +internal sealed record GetSteamNotificationsResponse +{ + [JsonPropertyName("response")] + public ResponseData? Response { get; set; } + + public sealed record ResponseData + { + [JsonPropertyName("notifications")] + public List? Notifications { get; set; } + + [JsonPropertyName("confirmation_count")] + public int ConfirmationCount { get; set; } + + [JsonPropertyName("pending_gift_count")] + public int PendingGiftCount { get; set; } + + [JsonPropertyName("pending_friend_count")] + public int PendingFriendCount { get; set; } + + [JsonPropertyName("unread_count")] + public int UnreadCount { get; set; } + + [JsonPropertyName("pending_family_invite_count")] + public int PendingFamilyInviteCount { get; set; } + } + + public sealed record NotificationData + { + [JsonPropertyName("notification_id")] + public string? NotificationId { get; set; } + + [JsonPropertyName("notification_targets")] + public int NotificationTargets { get; set; } + + [JsonPropertyName("notification_type")] + public int NotificationType { get; set; } + + [JsonPropertyName("body_data")] + public string? BodyData { get; set; } + + [JsonPropertyName("read")] + public bool Read { get; set; } + + [JsonPropertyName("timestamp")] + public long Timestamp { get; set; } + + [JsonPropertyName("hidden")] + public bool Hidden { get; set; } + + [JsonPropertyName("expiry")] + public long Expiry { get; set; } + + [JsonPropertyName("viewed")] + public long Viewed { get; set; } + } +} \ No newline at end of file diff --git a/ASFEnhance/Data/NotificationOptions.cs b/ASFEnhance/Data/NotificationOptions.cs index edd8d4f9..25b611c3 100644 --- a/ASFEnhance/Data/NotificationOptions.cs +++ b/ASFEnhance/Data/NotificationOptions.cs @@ -15,49 +15,6 @@ internal sealed record NotificationOptions public NotificationTarget SteamTurnNotification { get; set; } = NotificationTarget.OFF; } -/// -/// 通知类型 -/// -internal enum NotificationType : int -{ - /// - /// 收到礼物 - /// - ReceivedGift = 2, - /// - /// 订阅的讨论回复 - /// - SubscribedDissionReplyed, - /// - /// 有新物品 - /// - ReceivedNewItem, - /// - /// 收到好友邀请 - /// - ReceivedFriendInvitation, - /// - /// 大促开始 - /// - MajorSaleStart, - /// - /// 愿望单物品打折 - /// - ItemInWishlistOnSale = 8, - /// - /// 收到交易报价 - /// - ReceivedTradeOffer, - /// - /// 收到客服回复 - /// - ReceivedSteamSupportReply = 11, - /// - /// Steam回合通知 - /// - SteamTurnNotification, -} - [Flags] internal enum NotificationTarget : int { @@ -72,14 +29,14 @@ internal enum NotificationTarget : int internal sealed record NotificationPayload { - public NotificationPayload(NotificationType notificationType, NotificationTarget notificationTargets) + public NotificationPayload(ENotificationType notificationType, NotificationTarget notificationTargets) { NotificationType = notificationType; NotificationTargets = notificationTargets; } [JsonPropertyName("notification_type")] - public NotificationType NotificationType { get; set; } + public ENotificationType NotificationType { get; set; } [JsonPropertyName("notification_targets")] public NotificationTarget NotificationTargets { get; set; } diff --git a/ASFEnhance/Localization/Langs.Designer.cs b/ASFEnhance/Localization/Langs.Designer.cs index e34a96c3..a78b6e5f 100644 --- a/ASFEnhance/Localization/Langs.Designer.cs +++ b/ASFEnhance/Localization/Langs.Designer.cs @@ -1662,6 +1662,105 @@ internal static string MarketStatusNormal { } } + /// + /// 查找类似 Steam社区消息 的本地化字符串。 + /// + internal static string MsgCommunityMessage { + get { + return ResourceManager.GetString("MsgCommunityMessage", resourceCulture); + } + } + + /// + /// 查找类似 收到好友请求 的本地化字符串。 + /// + internal static string MsgFriendInviation { + get { + return ResourceManager.GetString("MsgFriendInviation", resourceCulture); + } + } + + /// + /// 查找类似 大型特卖 的本地化字符串。 + /// + internal static string MsgMajorSale { + get { + return ResourceManager.GetString("MsgMajorSale", resourceCulture); + } + } + + /// + /// 查找类似 无通知 的本地化字符串。 + /// + internal static string MsgNoMessage { + get { + return ResourceManager.GetString("MsgNoMessage", resourceCulture); + } + } + + /// + /// 查找类似 收到礼物 的本地化字符串。 + /// + internal static string MsgReceivedGift { + get { + return ResourceManager.GetString("MsgReceivedGift", resourceCulture); + } + } + + /// + /// 查找类似 收到新物品 的本地化字符串。 + /// + internal static string MsgReceivedNewItem { + get { + return ResourceManager.GetString("MsgReceivedNewItem", resourceCulture); + } + } + + /// + /// 查找类似 收到回复 的本地化字符串。 + /// + internal static string MsgReceivedReplyed { + get { + return ResourceManager.GetString("MsgReceivedReplyed", resourceCulture); + } + } + + /// + /// 查找类似 Steam客服消息 的本地化字符串。 + /// + internal static string MsgSteamSupport { + get { + return ResourceManager.GetString("MsgSteamSupport", resourceCulture); + } + } + + /// + /// 查找类似 SteamTurn消息 的本地化字符串。 + /// + internal static string MsgSteamTurn { + get { + return ResourceManager.GetString("MsgSteamTurn", resourceCulture); + } + } + + /// + /// 查找类似 收到报价 的本地化字符串。 + /// + internal static string MsgTradeOffer { + get { + return ResourceManager.GetString("MsgTradeOffer", resourceCulture); + } + } + + /// + /// 查找类似 愿望单折扣 的本地化字符串。 + /// + internal static string MsgWishlistItemOnSale { + get { + return ResourceManager.GetString("MsgWishlistItemOnSale", resourceCulture); + } + } + /// /// 查找类似 多行结果: 的本地化字符串。 /// @@ -1734,6 +1833,42 @@ internal static string NoBanRecords { } } + /// + /// 查找类似 待确认通知: {0} 的本地化字符串。 + /// + internal static string NocConfirmationCount { + get { + return ResourceManager.GetString("NocConfirmationCount", resourceCulture); + } + } + + /// + /// 查找类似 待处理家庭邀请: {0} 的本地化字符串。 + /// + internal static string NocPendingFamilyInviteCount { + get { + return ResourceManager.GetString("NocPendingFamilyInviteCount", resourceCulture); + } + } + + /// + /// 查找类似 待处理好友请求: {0} 的本地化字符串。 + /// + internal static string NocPendingFriendCount { + get { + return ResourceManager.GetString("NocPendingFriendCount", resourceCulture); + } + } + + /// + /// 查找类似 待处理礼物: {0} 的本地化字符串。 + /// + internal static string NocPendingGiftCount { + get { + return ResourceManager.GetString("NocPendingGiftCount", resourceCulture); + } + } + /// /// 查找类似 无可合成徽章 的本地化字符串。 /// @@ -1743,6 +1878,24 @@ internal static string NoCraftableBadge { } } + /// + /// 查找类似 未读通知: {0} 的本地化字符串。 + /// + internal static string NocUnreadCount { + get { + return ResourceManager.GetString("NocUnreadCount", resourceCulture); + } + } + + /// + /// 查找类似 待处理好友请求 的本地化字符串。 + /// + internal static string Noc待处理好友请求 { + get { + return ResourceManager.GetString("Noc待处理好友请求", resourceCulture); + } + } + /// /// 查找类似 不存在/已吊销ApiKey 的本地化字符串。 /// @@ -2013,6 +2166,15 @@ internal static string PluginVer { } } + /// + /// 查找类似 私信消息 的本地化字符串。 + /// + internal static string PrivateMessage { + get { + return ResourceManager.GetString("PrivateMessage", resourceCulture); + } + } + /// /// 查找类似 徽章: {0} 的本地化字符串。 /// diff --git a/ASFEnhance/Localization/Langs.resx b/ASFEnhance/Localization/Langs.resx index 1020300c..e2a6778b 100644 --- a/ASFEnhance/Localization/Langs.resx +++ b/ASFEnhance/Localization/Langs.resx @@ -1338,4 +1338,58 @@ 读取/修改配置文件出错 + + 收到礼物 + + + 收到回复 + + + SteamTurn消息 + + + Steam客服消息 + + + 收到报价 + + + 大型特卖 + + + 收到好友请求 + + + 收到新物品 + + + 愿望单折扣 + + + 无通知 + + + 私信消息 + + + Steam社区消息 + + + 未读通知: {0} + + + 待确认通知: {0} + + + 待处理礼物: {0} + + + 待处理好友请求 + + + 待处理好友请求: {0} + + + 待处理家庭邀请: {0} + \ No newline at end of file diff --git a/ASFEnhance/Utils.cs b/ASFEnhance/Utils.cs index 6e39a212..5601b043 100644 --- a/ASFEnhance/Utils.cs +++ b/ASFEnhance/Utils.cs @@ -338,9 +338,12 @@ internal static string UrlEncode(string url) byte maxTries = WebBrowser.MaxTries, int rateLimitingDelay = 0, bool allowSessionRefresh = true, - CancellationToken cancellationToken = default) => handler.UrlPostToJsonObjectWithSession(request, null, data, referer, requestOptions, ESession.None, checkSessionPreemptively, maxTries, rateLimitingDelay, allowSessionRefresh, cancellationToken); + CancellationToken cancellationToken = default) + { + return handler.UrlPostToJsonObjectWithSession(request, null, data, referer, requestOptions, ESession.None, checkSessionPreemptively, maxTries, rateLimitingDelay, allowSessionRefresh, cancellationToken); + } - public static Task UrlPost(this ArchiWebHandler handler, + internal static Task UrlPost(this ArchiWebHandler handler, Uri request, IDictionary? data = null, Uri? referer = null, @@ -349,7 +352,10 @@ public static Task UrlPost(this ArchiWebHandler handler, byte maxTries = WebBrowser.MaxTries, int rateLimitingDelay = 0, bool allowSessionRefresh = true, - CancellationToken cancellationToken = default) => handler.UrlPostWithSession(request, null, data, referer, requestOptions, ESession.None, checkSessionPreemptively, maxTries, rateLimitingDelay, allowSessionRefresh, cancellationToken); + CancellationToken cancellationToken = default) + { + return handler.UrlPostWithSession(request, null, data, referer, requestOptions, ESession.None, checkSessionPreemptively, maxTries, rateLimitingDelay, allowSessionRefresh, cancellationToken); + } internal static string GetGifteeProfile(ulong accountId) { diff --git a/Directory.Build.props b/Directory.Build.props index f8f33f10..e5a477d3 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 2.2.0.1 + 2.2.1.0