Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
chr233 committed Nov 12, 2023
1 parent 9ec10f9 commit ce29f1a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>2.2.4.1</Version>
<Version>2.2.4.2</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down
11 changes: 5 additions & 6 deletions XinjingdailyBot.Command/ReviewCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,15 @@ async Task<string> 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();
Expand Down Expand Up @@ -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);
}

/// <summary>
Expand Down
3 changes: 2 additions & 1 deletion XinjingdailyBot.Interface/Data/IPostService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ public interface IPostService : IBaseService<NewPosts>
/// <param name="post"></param>
/// <param name="dbUser"></param>
/// <param name="rejectReason"></param>
/// <param name="htmlRejectMessage"></param>
/// <returns></returns>
Task RejectPost(NewPosts post, Users dbUser, RejectReasons rejectReason);
Task RejectPost(NewPosts post, Users dbUser, RejectReasons rejectReason, string? htmlRejectMessage);
/// <summary>
/// 设置稿件Tag
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions XinjingdailyBot.Service/Data/PostService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ce29f1a

Please sign in to comment.