[Feature] Generic autocomplete (#2935)

This commit is contained in:
Mihail Gribkov
2024-06-14 11:22:40 +03:00
committed by GitHub
parent 3be72a8ae6
commit 35b102a7c0

View File

@@ -1,7 +1,7 @@
using System;
namespace Discord.Interactions
{
namespace Discord.Interactions;
/// <summary>
/// Set the <see cref="ApplicationCommandOptionProperties.IsAutocomplete"/> to <see langword="true"/>.
/// </summary>
@@ -27,10 +27,12 @@ namespace Discord.Interactions
AutocompleteHandlerType = autocompleteHandlerType;
}
}
/// <summary>
/// Set the <see cref="ApplicationCommandOptionProperties.IsAutocomplete"/> to <see langword="true"/> without specifying a <see cref="AutocompleteHandler"/>.
/// Set the <see cref="ApplicationCommandOptionProperties.IsAutocomplete"/> to <see langword="true"/>.
/// </summary>
public AutocompleteAttribute() { }
}
}
/// <typeparam name="T">Type of the <see cref="AutocompleteHandler"/> that will be used to handle Autocomplete interactions targeting the parameter.</typeparam>
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)]
public class AutocompleteAttribute<T>() : AutocompleteAttribute(typeof(T))
where T : class, IAutocompleteHandler;