/// <summary> /// 初始化 /// </summary> /// <param name="connectionGuid">服务器链接标识</param> /// <param name="eventName">事件名</param> /// <param name="groupRequestArgs">加群申请事件参数</param> internal AddGroupRequestEventArgs(Guid connectionGuid, string eventName, ApiGroupRequestEventArgs groupRequestArgs) : base(connectionGuid, eventName, groupRequestArgs.SelfID, groupRequestArgs.Time) { this.Sender = new User(connectionGuid, groupRequestArgs.UserId); this.SourceGroup = new Group(connectionGuid, groupRequestArgs.GroupId); this.Comment = groupRequestArgs.Comment; this.RequsetFlag = groupRequestArgs.Flag; this.SubType = groupRequestArgs.GroupRequestType; }
/// <summary> /// 初始化 /// </summary> /// <param name="serviceId">服务ID</param> /// <param name="connectionId">服务器链接标识</param> /// <param name="eventName">事件名</param> /// <param name="groupObRequestArgs">加群申请事件参数</param> internal AddGroupRequestEventArgs(Guid serviceId, Guid connectionId, string eventName, OnebotGroupObRequestEventArgs groupObRequestArgs) : base(serviceId, connectionId, eventName, groupObRequestArgs.SelfId, groupObRequestArgs.Time, SourceFlag.Group) { Sender = new User(serviceId, connectionId, groupObRequestArgs.UserId); SourceGroup = new Group(serviceId, connectionId, groupObRequestArgs.GroupId); Comment = groupObRequestArgs.Comment; RequestFlag = groupObRequestArgs.Flag; SubType = groupObRequestArgs.GroupRequestType; }
/// <summary> /// 处理加群请求/邀请 /// </summary> /// <param name="flag">请求flag</param> /// <param name="requestType">请求类型</param> /// <param name="approve">是否同意</param> /// <param name="reason">拒绝理由</param> public async ValueTask SetGroupAddRequest(string flag, GroupRequestType requestType, bool approve, string reason = null) { if (string.IsNullOrEmpty(flag)) { throw new NullReferenceException(nameof(flag)); } await ApiInterface.SetGroupAddRequest(this.ConnectionGuid, flag, requestType, approve, reason); }
public void Make(GroupRequestType request) { Interlocked.Exchange(ref _request, (int)request); }