diff --git a/Directory.Build.props b/Directory.Build.props index a92a6025..b4a1de18 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 2.2.4.1 + 2.2.4.2 diff --git a/XinjingdailyBot.Command/ReviewCommand.cs b/XinjingdailyBot.Command/ReviewCommand.cs index 043ebfe4..062d692e 100644 --- a/XinjingdailyBot.Command/ReviewCommand.cs +++ b/XinjingdailyBot.Command/ReviewCommand.cs @@ -84,16 +84,15 @@ async Task exec() return "请输入拒绝理由"; } - var text = _textHelperService.ParseMessage(message); - - post.RejectReason = text[4..]; + var htmlText = _textHelperService.ParseMessage(message)[4..]; + post.RejectReason = reason; var rejectReason = new RejectReasons { Name = reason, FullText = reason, }; - await _postService.RejectPost(post, dbUser, rejectReason); + await _postService.RejectPost(post, dbUser, rejectReason, htmlText); - return $"已拒绝该稿件, 理由: {reason}"; + return $"已拒绝该稿件, 理由: {htmlText}"; } var text = await exec(); @@ -325,7 +324,7 @@ private async Task RejectPostHelper(NewPosts post, Users dbUser, CallbackQuery q await _botClient.AutoReplyAsync($"找不到 {payload} 对应的拒绝理由", query, true); return; } - await _postService.RejectPost(post, dbUser, reason); + await _postService.RejectPost(post, dbUser, reason, null); } /// diff --git a/XinjingdailyBot.Interface/Data/IPostService.cs b/XinjingdailyBot.Interface/Data/IPostService.cs index 275af022..59396a1a 100644 --- a/XinjingdailyBot.Interface/Data/IPostService.cs +++ b/XinjingdailyBot.Interface/Data/IPostService.cs @@ -84,8 +84,9 @@ public interface IPostService : IBaseService /// /// /// + /// /// - Task RejectPost(NewPosts post, Users dbUser, RejectReasons rejectReason); + Task RejectPost(NewPosts post, Users dbUser, RejectReasons rejectReason, string? htmlRejectMessage); /// /// 设置稿件Tag /// diff --git a/XinjingdailyBot.Service/Data/PostService.cs b/XinjingdailyBot.Service/Data/PostService.cs index 1d9a7a4f..a7fe81a1 100644 --- a/XinjingdailyBot.Service/Data/PostService.cs +++ b/XinjingdailyBot.Service/Data/PostService.cs @@ -527,7 +527,7 @@ public async Task SetPostTag(NewPosts post, string payload, CallbackQuery callba } } - public async Task RejectPost(NewPosts post, Users dbUser, RejectReasons rejectReason) + public async Task RejectPost(NewPosts post, Users dbUser, RejectReasons rejectReason, string? htmlRejectMessage) { var poster = await _userService.Queryable().FirstAsync(x => x.UserID == post.PosterUID); @@ -622,7 +622,7 @@ public async Task RejectPost(NewPosts post, Users dbUser, RejectReasons rejectRe } //通知投稿人 - string posterMsg = _textHelperService.MakeNotification(rejectReason.FullText); + string posterMsg = _textHelperService.MakeNotification(htmlRejectMessage ?? rejectReason.FullText); if (poster.Notification) { await _botClient.SendTextMessageAsync(post.OriginChatID, posterMsg, parseMode: ParseMode.Html, replyToMessageId: (int)post.OriginMsgID, allowSendingWithoutReply: true);