/// <summary> /// 初始化 /// </summary> /// <param name="connectionGuid">服务器链接标识</param> /// <param name="eventName">事件名</param> /// <param name="groupMemberChangeArgs">群成员数量变更参数</param> internal GroupMemberChangeEventArgs(Guid connectionGuid, string eventName, ApiGroupMemberChangeEventArgs groupMemberChangeArgs) : base(connectionGuid, eventName, groupMemberChangeArgs.SelfID, groupMemberChangeArgs.Time) { this.ChangedUser = new User(connectionGuid, groupMemberChangeArgs.UserId); //执行者和变动成员可能为同一人 this.Operator = groupMemberChangeArgs.UserId == groupMemberChangeArgs.OperatorId ? this.ChangedUser : new User(connectionGuid, groupMemberChangeArgs.OperatorId); this.SourceGroup = new Group(connectionGuid, groupMemberChangeArgs.GroupId); this.SubType = groupMemberChangeArgs.SubType; }
/// <summary> /// 初始化 /// </summary> /// <param name="serviceId">服务ID</param> /// <param name="connectionId">服务器链接标识</param> /// <param name="eventName">事件名</param> /// <param name="groupMemberChangeArgs">群成员数量变更参数</param> internal GroupMemberChangeEventArgs(Guid serviceId, Guid connectionId, string eventName, OnebotGroupMemberChangeEventArgs groupMemberChangeArgs) : base(serviceId, connectionId, eventName, groupMemberChangeArgs.SelfId, groupMemberChangeArgs.Time, SourceFlag.Group) { ChangedUser = new User(serviceId, connectionId, groupMemberChangeArgs.UserId); //执行者和变动成员可能为同一人 Operator = groupMemberChangeArgs.UserId == groupMemberChangeArgs.OperatorId ? ChangedUser : new User(serviceId, connectionId, groupMemberChangeArgs.OperatorId); SourceGroup = new Group(serviceId, connectionId, groupMemberChangeArgs.GroupId); SubType = groupMemberChangeArgs.SubType; }