From a4cf3d42b82b982f7b081f93326864f7a23a4928 Mon Sep 17 00:00:00 2001 From: Shua Date: Sun, 5 Jan 2025 03:20:04 +0800 Subject: [PATCH] Update Lagrange.OneBot/Core/Operation/Message/SendPokeOperation.cs Co-authored-by: DarkRRb <177549718+DarkRRb@users.noreply.github.com> --- Lagrange.OneBot/Core/Operation/Message/SendPokeOperation.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Lagrange.OneBot/Core/Operation/Message/SendPokeOperation.cs b/Lagrange.OneBot/Core/Operation/Message/SendPokeOperation.cs index 4fee67bf0..8611f1e32 100644 --- a/Lagrange.OneBot/Core/Operation/Message/SendPokeOperation.cs +++ b/Lagrange.OneBot/Core/Operation/Message/SendPokeOperation.cs @@ -15,13 +15,14 @@ public async Task HandleOperation(BotContext context, JsonNode? pa if (payload.Deserialize(SerializerOptions.DefaultOptions) is { } poke) { if (poke.GroupId == null) + if (poke.GroupId.HasValue) { - bool result = await context.FriendPoke(poke.UserId); + bool result = await context.GroupPoke(poke.GroupId.Value, poke.UserId); return new OneBotResult(null, result ? 0 : 1, result ? "ok" : "failed"); } else { - bool result = await context.GroupPoke(poke.GroupId.Value, poke.UserId); + bool result = await context.FriendPoke(poke.UserId); return new OneBotResult(null, result ? 0 : 1, result ? "ok" : "failed"); } }