-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Audio status to voice channel #6591
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
base: V3/develop
Are you sure you want to change the base?
Audio status to voice channel #6591
Conversation
…pdate voice channel with current playing song
Jackenmen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation looks mostly fine but there is some discussion to be had about how configurable this should be (global and/or per-server), what the default should be (I personally want us to at least consider having it enabled by default), and how we should handle the destructiveness of editing the voice status (i.e. if the user of a channel sets their own status and then the bot ends up overriding it).
| playing_servers = 0 | ||
| return get_single_title, playing_servers | ||
|
|
||
| async def get_current_track_title(self) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this method reuses code from get_active_player_count(), we should update get_active_player_count() to just call it.
| if event_type == lavalink.LavalinkEvents.TRACK_START and vc_status: | ||
| log.debug("Track started for %s, updating voice channel status", guild_id) | ||
| voice_channel = current_channel | ||
| track_title = await self.get_current_track_title() | ||
| await self.update_voice_channel_presence(voice_channel, track_title) | ||
|
|
||
| if event_type == lavalink.LavalinkEvents.TRACK_END and vc_status: | ||
| await asyncio.sleep(1) | ||
| if not player.is_playing: | ||
| log.debug("Track ended for %s, updating voice channel status", guild_id) | ||
| voice_channel = current_channel | ||
| track_title = await self.get_current_track_title() | ||
| await self.update_voice_channel_presence(voice_channel, track_title) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think merging the code from these two if statements with the code right above might be a good idea. The coed doesn't seem that different + we'd avoid an additional sleep call.
|
wow |
|
Looking forward to this still, nice work :) |
Description of the changes
Add enhancement to audio cog to enable Red to update the Voice Channel status to the current playing song.
Added an additional command to allow for both Bot status updates ([p]audioset status) and Voice Channel status updates ([p]audioset voicestatus)
Related: #6442
Have the changes in this PR been tested?
Yes