Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: The bot is by default deafened and we don't want that #437

Merged

Conversation

martincik
Copy link
Contributor

Relates to:

(No linked issue provided in the diff)

Risks

Low - Changes only affect voice channel behavior for the Discord bot, specifically its deafened/muted state when joining channels.

Background

What does this PR do?

This PR fixes an issue where the Discord bot was joining voice channels in a deafened state by default. The changes include:

  1. Explicitly setting the bot to undeafened and unmuted when joining voice channels
  2. Improved voice connection cleanup by clearing streams and monitors when destroying old connections
  3. Added error handling for voice connections
  4. Refactored voice channel join logic to use VoiceManager instead of direct joinVoiceChannel calls

What kind of change is this?

Bug fix (non-breaking change which fixes an issue)

Documentation changes needed?

My changes do not require a change to the project documentation.

Testing

Where should a reviewer start?

  1. Review the changes in packages/client-discord/src/actions/joinvoice.ts where joinVoiceChannel calls are replaced with state.voiceManager
  2. Check the new voice connection setup in packages/client-discord/src/voice.ts

Detailed testing steps

  1. As a user, invite the bot to a Discord server
  2. Join a voice channel
  3. Make the bot join the same voice channel
  4. Verify that:
    • The bot joins successfully
    • The bot is not deafened by default
    • The bot is not muted by default
    • The bot can properly hear and process voice input from users

The automated tests should be updated to verify this behaviour remains consistent.

Copy link
Collaborator

@odilitime odilitime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lalalune lalalune merged commit b31f600 into elizaOS:main Nov 20, 2024
2 checks passed
@martincik martincik deleted the fix/undefean-the-bot-and-use-voice-manager branch November 20, 2024 21:30
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.

3 participants