From 4d0af92e633e7787f303193d2aec19be5d1020bf Mon Sep 17 00:00:00 2001 From: Linwenxuan Date: Sat, 2 Mar 2024 23:29:26 +0800 Subject: [PATCH] [OneBot] Implemented mark_msg_as_read Operation --- Lagrange.Core/Message/Entity/FileEntity.cs | 2 +- .../Core/Operation/Message/MarkMsgAsReadOperation.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Lagrange.Core/Message/Entity/FileEntity.cs b/Lagrange.Core/Message/Entity/FileEntity.cs index 71d27ecdb..849fde76d 100644 --- a/Lagrange.Core/Message/Entity/FileEntity.cs +++ b/Lagrange.Core/Message/Entity/FileEntity.cs @@ -37,7 +37,7 @@ public FileEntity() /// /// This entity could not be directly sent via , - /// it should be sent via + /// it should be sent via /// public FileEntity(string path) { diff --git a/Lagrange.OneBot/Core/Operation/Message/MarkMsgAsReadOperation.cs b/Lagrange.OneBot/Core/Operation/Message/MarkMsgAsReadOperation.cs index 283fa6b33..3e50f63a5 100644 --- a/Lagrange.OneBot/Core/Operation/Message/MarkMsgAsReadOperation.cs +++ b/Lagrange.OneBot/Core/Operation/Message/MarkMsgAsReadOperation.cs @@ -19,7 +19,8 @@ public async Task HandleOperation(BotContext context, JsonNode? pa { var record = database.GetCollection().FindOne(x => x.MessageHash == getMsg.MessageId); var chain = (MessageChain)record; - await context.MarkAsRead(chain); + bool result = await context.MarkAsRead(chain); + return new OneBotResult(null, result ? 0 : 1, result ? "ok" : "failed"); } throw new Exception();