Skip to content

Commit

Permalink
Update Lagrange.OneBot/Core/Operation/Message/SendPokeOperation.cs
Browse files Browse the repository at this point in the history
Co-authored-by: DarkRRb <[email protected]>
  • Loading branch information
Shua-github and DarkRRb authored Jan 4, 2025
1 parent 06e5679 commit a4cf3d4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Lagrange.OneBot/Core/Operation/Message/SendPokeOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ public async Task<OneBotResult> HandleOperation(BotContext context, JsonNode? pa
if (payload.Deserialize<OneBotSendPoke>(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");
}
}
Expand Down

0 comments on commit a4cf3d4

Please sign in to comment.