Skip to content

[Core & Milky] Implement accept_group_invitation action#41

Closed
Szzrain wants to merge 4 commits into
LagrangeDev:mainfrom
Szzrain:accept-group-invitation
Closed

[Core & Milky] Implement accept_group_invitation action#41
Szzrain wants to merge 4 commits into
LagrangeDev:mainfrom
Szzrain:accept-group-invitation

Conversation

@Szzrain
Copy link
Copy Markdown
Contributor

@Szzrain Szzrain commented Aug 18, 2025

No description provided.

Copilot AI review requested due to automatic review settings August 18, 2025 09:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements the accept_group_invitation action functionality for the Lagrange bot framework, allowing users to programmatically accept group invitations through the API.

  • Adds a new API handler for accepting group invitations with required parameters
  • Implements the underlying service layer communication using the 0x10C8 protocol
  • Exposes the functionality through the bot context interface

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Lagrange.Milky/Utility/JsonUtility.cs Adds JSON serialization support for the new parameter type
Lagrange.Milky/Api/Handler/Request/AcceptGroupInvitationRequestHandler.cs Implements the API handler and parameter class for accepting group invitations
Lagrange.Core/Internal/Services/System/SetGroupInviteAcceptService.cs Creates the service layer for handling group invitation acceptance protocol
Lagrange.Core/Internal/Packets/Service/Oidb_0x10C8.cs Defines protocol packet structures for the 0x10C8 service
Lagrange.Core/Internal/Logic/OperationLogic.cs Adds the business logic method for accepting group invitations
Lagrange.Core/Internal/Events/System/SetGroupInviteSelfAcceptEvent.cs Defines the event classes for group invitation acceptance
Lagrange.Core/Common/Interface/MessageExt.cs Exposes the functionality through the BotContext extension method

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Comment thread Lagrange.Core/Internal/Packets/Service/Oidb_0x10C8.cs Outdated
Comment thread Lagrange.Core/Internal/Services/System/SetGroupInviteAcceptService.cs Outdated
Comment thread Lagrange.Core/Internal/Services/System/SetGroupInviteAcceptService.cs Outdated
@@ -0,0 +1,35 @@
using System.Text;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate Service! SetGroupNotificationService.cs

This will cause the process to fail! Didn't you test it?

await context.EventContext.SendEvent<GroupMemberRenameEventResp>(new GroupMemberRenameEventReq(groupUin, uid, name));
}

public async Task SetGroupInviteSelfAccept(long groupUin, long sequence)
Copy link
Copy Markdown
Collaborator

@NoirHare NoirHare Aug 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use SetGroupNotification!

@@ -0,0 +1,13 @@
namespace Lagrange.Core.Internal.Events.System;
Copy link
Copy Markdown
Collaborator

@NoirHare NoirHare Aug 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use SetGroupNotification! Remove this event


public static Task GroupQuit(this BotContext context, long groupUin)
=> context.EventContext.GetLogic<OperationLogic>().GroupQuit(groupUin);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use SetGroupNotification!

Comment thread Lagrange.Core/Internal/Packets/Service/Oidb_0x10C8.cs Outdated
@Szzrain Szzrain requested a review from NoirHare August 18, 2025 09:48
@Szzrain Szzrain force-pushed the accept-group-invitation branch from 6825c5e to fc560c0 Compare August 18, 2025 09:56
@NoirHare NoirHare closed this Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants