Exemplo n.º 1
0
 /// <summary>
 /// 异步处理加群请求
 /// </summary>
 /// <param name="args">收到用户入群申请事件中的参数</param>
 /// <param name="action">处理方式</param>
 /// <param name="message">附加信息</param>
 public Task HandleGroupApplyAsync(IApplyResponseArgs args, GroupApplyActions 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/memberJoinRequestEvent", payload));
 }
 /// <inheritdoc/>
 public abstract Task HandleGroupApplyAsync(IApplyResponseArgs args, GroupApplyActions action, string?message = null, CancellationToken token = default);
Exemplo n.º 3
0
 /// <summary>
 /// 异步处理加群请求
 /// </summary>
 /// <param name="args">收到用户入群申请事件中的参数, 即 <see cref="IGroupApplyEventArgs"/></param>
 /// <inheritdoc cref="CommonHandleApplyAsync"/>
 public Task HandleGroupApplyAsync(IApplyResponseArgs args, GroupApplyActions action, string message = "")
 {
     return(CommonHandleApplyAsync("memberJoinRequestEvent", args, (int)action, message));
 }
Exemplo n.º 4
0
 /// <summary>
 /// 异步处理Bot受邀加群请求
 /// </summary>
 /// <param name="args">Bot受邀入群事件中的参数, 即 <see cref="IBotInvitedJoinGroupEventArgs"/></param>
 /// <inheritdoc cref="CommonHandleApplyAsync"/>
 public Task HandleBotInvitedJoinGroupAsync(IApplyResponseArgs args, GroupApplyActions action, string message = "")
 {
     return(CommonHandleApplyAsync("botInvitedJoinGroupRequestEvent", args, (int)action, message));
 }
 /// <inheritdoc/>
 public override Task HandleBotInvitedJoinGroupAsync(IApplyResponseArgs args, GroupApplyActions action, string?message = null, CancellationToken token = default)
 {
     return(CommonHandleApplyAsync("botInvitedJoinGroupRequestEvent", args, (int)action, message, token));
 }