Skip to content

[Bug]: System.InvalidOperationException: Discord does not support xsalsa20_poly1305 #3155

@standleypg

Description

@standleypg

Check The Docs

  • I double checked the docs and couldn't find any useful information.

Verify Issue Source

  • I verified the issue was caused by Discord.Net.

Check your intents

  • I double checked that I have the required intents.

Description

Summary

When attempting to connect to a voice channel using voiceChannel.ConnectAsync(), the application throws a System.InvalidOperationException with the message "Discord does not support xsalsa20_poly1305".

Steps to Reproduce

  1. Create a Discord bot using Discord.NET
  2. Attempt to connect to a voice channel using:
    var audioClient = await voiceChannel.ConnectAsync();
  3. The exception is thrown during the connection attempt

Expected Behavior

The voice connection should establish successfully using a supported encryption method.

Actual Behavior

The application throws System.InvalidOperationException: Discord does not support xsalsa20_poly1305 and fails to connect to the voice channel.

Additional Information

  1. This error occurs specifically during voice channel connection
  2. The error suggests that Discord.NET is attempting to use an unsupported encryption method
  3. The issue may be related to libsodium dependencies or Discord's supported encryption methods

Possible Solutions to Investigate

  1. Automatic fallback to supported encryption methods
  2. Better error messaging indicating which encryption methods are currently supported
  3. Documentation updates regarding supported encryption methods
  4. Dependency checks for libsodium compatibility

Version

3.17.4

Working Version

No response

Logs

[Audio #2] Error handling Ready
      System.InvalidOperationException: Discord does not support xsalsa20_poly1305
         at Discord.Audio.AudioClient.ProcessMessageAsync(VoiceOpCode opCode, Object payload)

Sample

var audioClient = await voiceChannel.ConnectAsync();

Packages

Opus version: v1.5.2
Libsodium version: v1.0.20

Environment

.NET Version: .NET 9.0.*
Platform: x64 - Fedora Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions