fix: implement persistent volume across sessions and song transitions#119
Open
yuv41 wants to merge 2 commits intoChocoMeow:mainfrom
Open
fix: implement persistent volume across sessions and song transitions#119yuv41 wants to merge 2 commits intoChocoMeow:mainfrom
yuv41 wants to merge 2 commits intoChocoMeow:mainfrom
Conversation
This commit ensures that the volume setting is saved to the database upon change and correctly applied whenever a player connects or restores a session. It also includes a fix for channelId in voice updates to improve session stability.
ChocoMeow
reviewed
Mar 30, 2026
| await self.send(method=RequestMethod.PATCH, data={"volume": volume}) | ||
| self._volume = volume | ||
| self.settings['volume'] = volume | ||
| await func.update_settings(self.guild.id, {"$set": {"volume": volume}}) |
Owner
There was a problem hiding this comment.
The volume settings have already been updated in the volume command. However, I’m curious why the volume settings need to be updated in the database each time the bot connects to the channel.
Author
There was a problem hiding this comment.
yeah ig you're right, it was double-saving during connection. i put the DB update inside set_volume so it would catch changes from the controller buttons, but forgot that it also runs every time the bot joins a channel.
i've tweaked it so it only updates the database if the volume actually changes. i also removed the redundant manual saves from the volume command and IPC since set_volume handles it all now. This
keeps it persistent without the unnecessary writes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit ensures that the volume setting is saved to the database upon change and correctly applied whenever a player connects or restores a session. It also includes a fix for channelId in voice updates to improve session stability.