Skip to content

Conversation

@LordOfPolls
Copy link
Contributor

Pull Request Type

  • Feature addition
  • Bugfix
  • Documentation update
  • Code refactor
  • Tests improvement
  • CI/CD pipeline enhancement
  • Other: [Replace with a description]

Description

Adds support for aead_xchacha20_poly1305_rtpsize and aead_aes256_gcm_rtpsize
Fixes a bug where encryption errors would be silently eaten

Changes

  • Add new dep cryptography as PyNACL intentionally doesnt support the above encryption
  • Add methods for (de)cryption of the above
  • Adds proper error handling to encryption call

Related Issues

Test Scenarios

import logging
import os

import interactions
from interactions import (
    Client,
    listen,
    ActiveVoiceState,
)
from interactions.api.voice.audio import AudioVolume

logging.basicConfig()
logging.getLogger("interactions").setLevel(logging.DEBUG)

bot = Client()

@listen()
async def on_startup():
    print(f"Logged in as {bot.user}")


@bot.event()
async def on_ready():
    print("Im ready!")


@interactions.slash_command("play")
async def play(ctx: interactions.SlashContext):
    await ctx.send("Connecting...")

    if not ctx.voice_state:
        await ctx.author.voice.channel.connect()

    audio = AudioVolume("tests/test_audio.mp3")
    state: ActiveVoiceState = ctx.voice_state

    state.play_no_wait(audio)

    await ctx.send(f"Using {state.ws.voice_modes[0]}")

bot.start(os.environ["TOKEN"])

Python Compatibility

  • I've ensured my code works on Python 3.10.x
  • I've ensured my code works on Python 3.11.x

Checklist

  • I've run the pre-commit code linter over all edited files
  • I've tested my changes on supported Python versions
  • I've added tests for my code, if applicable
  • I've updated / added documentation, where applicable

pynacl intentionally doesnt support them, so adding cryptography dep
@LordOfPolls LordOfPolls requested a review from silasary December 15, 2025 21:11
@silasary silasary merged commit 4c89c56 into interactions-py:unstable Dec 15, 2025
2 checks passed
@LordOfPolls LordOfPolls deleted the new-voice-encrypt branch December 15, 2025 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants