/// <summary> /// Responds to this interaction with a set of choices. /// </summary> /// <param name="result"> /// The set of choices for the user to pick from. /// <remarks> /// A max of 25 choices are allowed. Passing <see langword="null"/> for this argument will show the executing user that /// there is no choices for their autocompleted input. /// </remarks> /// </param> /// <param name="options">The request options for this response.</param> /// <returns> /// A task that represents the asynchronous operation of responding to this interaction. /// </returns> public async Task RespondAsync(IEnumerable <AutocompleteResult> result, RequestOptions options = null) { if (!InteractionHelper.CanSendResponse(this)) { throw new TimeoutException($"Cannot respond to an interaction after {InteractionHelper.ResponseTimeLimit} seconds!"); } lock (_lock) { if (HasResponded) { throw new InvalidOperationException("Cannot respond twice to the same interaction"); } } await InteractionHelper.SendAutocompleteResultAsync(Discord, result, Id, Token, options).ConfigureAwait(false); lock (_lock) { HasResponded = true; } }