/// <summary> /// 异步处理添加好友请求 /// </summary> /// <param name="args">收到添加好友申请事件中的参数</param> /// <param name="action">处理方式</param> /// <param name="message">附加信息</param> public Task HandleNewFriendApplyAsync(IApplyResponseArgs args, FriendApplyAction action, string message = "") { CheckConnected(); byte[] payload = JsonSerializer.SerializeToUtf8Bytes(new { sessionKey = SessionInfo.SessionKey, eventId = args.EventId, fromId = args.FromQQ, groupId = args.FromGroup, operate = (int)action, message }); return(InternalHttpPostAsync($"{SessionInfo.Options.BaseUrl}/resp/newFriendRequestEvent", payload)); }
/// <inheritdoc/> public abstract Task HandleNewFriendApplyAsync(IApplyResponseArgs args, FriendApplyAction action, string?message = null, CancellationToken token = default);
public static Task HandleNewFriendApplyAsync(IApplyResponseArgs args, FriendApplyAction action) => session.HandleNewFriendApplyAsync(args, action);
/// <summary> /// 异步处理添加好友请求 /// </summary> /// <param name="args">收到添加好友申请事件中的参数, 即<see cref="INewFriendApplyEventArgs"/></param> /// <inheritdoc cref="CommonHandleApplyAsync"/> public Task HandleNewFriendApplyAsync(IApplyResponseArgs args, FriendApplyAction action, string message = "") { return(CommonHandleApplyAsync("newFriendRequestEvent", args, (int)action, message)); }
/// <inheritdoc/> public override Task HandleNewFriendApplyAsync(IApplyResponseArgs args, FriendApplyAction action, string?message = null, CancellationToken token = default) { return(CommonHandleApplyAsync("newFriendRequestEvent", args, (int)action, message, token)); }