Skip to content

DSharpPlusNightly: Failed to compare two elements in the array #163

@milesring

Description

@milesring

Describe the bug
Command fails to execute once IAudioService is injected into the class.

at System.Collections.Generic.ArraySortHelper`1.Sort(Span`1 keys, Comparison`1 comparer)
...
DSharpPlus.Commands.DefaultCommandExecutor.ExecuteCoreAsync(CommandContext context)

To Reproduce
Steps to reproduce the behavior:

  1. Configure services and build service collection
            services.AddLavalink();
            services.ConfigureLavalink(config =>{//configure lavalink });
  1. Inject IAudioService into command class
        public TestCommands(ILogger<TestCommands> logger, IAudioService audioService)
        {
            _logger = logger;
            _audioService = audioService;
        }
  1. Execute command, in my case SlashCommand /test
        [Command("test")]
        public async Task TestCommandExecuteAsync(SlashCommandContext context)
        {
            //command actions
         }
  1. Removing the injection of IAudioService removes the error.

Expected behavior
Command executes as designed

Packages

  • DSharpPlus 5.0.0-nightly-02317
  • Lavalink4NET 4.0.19-beta.6
  • Lavalink4NET.DSharpPlus.Nightly 4.0.19-beta.6
    or
  • Lavalink4NET.DSharpPlus 4.0.19-beta.6
  • Exception thrown? (consider enabling logging)

Additional context
StackTrace.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions