Summary
Currently one has to use a string array to initialize variadic arguments in DSP.C. The docs article however specifies it should be (only) possible with IReadOnlyList<string>.
Reference: https://discord.com/channels/379378609942560770/1094835363475886163/1312537478095310909
What version of the library are you using?
v5.0.0-nightly (make sure you are using the latest nightly!)
What .NET version are you using? Make sure to use the latest patch release for your major version.
.NET 9.0
Operating System
Windows 11 23H2 22635.4515
Reproduction Steps
- Create a new command and specify VariadicArgument in the attribute
- Initialize it with an IReadOnlyList<string>
- See the error message during initialization
Trace Logs
Exceptions or other error messages
DSharpPlus.IClientErrorHandler[0] Event handler exception for event DSharpPlus.EventArgs.ClientStartedEventArgs thrown from System.Threading.Tasks.Task lambda_method13(System.Runtime.CompilerServices.Closure, DSharpPlus.DiscordClient, DSharpPlus.EventArgs.ClientStartedEventArgs, System.IServiceProvider) (defined in (null)).
System.InvalidOperationException: No converter found for parameter type 'IReadOnlyList`1'
at DSharpPlus.Commands.Processors.SlashCommands.SlashCommandProcessor.ToApplicationParameterAsync(Command command, CommandParameter parameter, Int32 i)
at DSharpPlus.Commands.Processors.SlashCommands.SlashCommandProcessor.PopulateVariadicParametersAsync(Command command, List`1 options)
at DSharpPlus.Commands.Processors.SlashCommands.SlashCommandProcessor.ToApplicationParameterAsync(Command command, Int32 depth)
at DSharpPlus.Commands.Processors.SlashCommands.SlashCommandProcessor.ToApplicationParameterAsync(Command command)
at DSharpPlus.Commands.Processors.SlashCommands.SlashCommandProcessor.ToApplicationCommandAsync(Command command)
at DSharpPlus.Commands.Processors.SlashCommands.SlashCommandProcessor.RegisterSlashCommandsAsync(CommandsExtension extension)
at DSharpPlus.Commands.Processors.SlashCommands.SlashCommandProcessor.ConfigureAsync(CommandsExtension extension)
at DSharpPlus.Commands.CommandsExtension.RefreshAsync()
at DSharpPlus.Commands.RefreshEventHandler.HandleEventAsync(DiscordClient sender, ClientStartedEventArgs eventArgs)
at DSharpPlus.Clients.DefaultEventDispatcher.<>c__DisplayClass6_0`1.<<DispatchAsync>b__0>d.MoveNext()
Anything else you'd like to share
No response
Reactions are currently unavailable
Summary
Currently one has to use a string array to initialize variadic arguments in DSP.C. The docs article however specifies it should be (only) possible with IReadOnlyList<string>.
Reference: https://discord.com/channels/379378609942560770/1094835363475886163/1312537478095310909
What version of the library are you using?
v5.0.0-nightly (make sure you are using the latest nightly!)
What .NET version are you using? Make sure to use the latest patch release for your major version.
.NET 9.0
Operating System
Windows 11 23H2 22635.4515
Reproduction Steps
Trace Logs
Exceptions or other error messages
Anything else you'd like to share
No response