Skip to content

Conversation

@bryceoj
Copy link

@bryceoj bryceoj commented Aug 1, 2025

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)

Capture
Screenshot 2025-07-31 213328
Screenshot 2025-07-31 213212

Related: #6442

Have the changes in this PR been tested?

Yes

@github-actions github-actions bot added the Category: Cogs - Audio This is related to the Audio cog. label Aug 1, 2025
@bryceoj bryceoj changed the title Audio status to voice channel #6442 Audio status to voice channel Cog-Creators/Red-DiscordBot#6442 Aug 1, 2025
@bryceoj bryceoj changed the title Audio status to voice channel Cog-Creators/Red-DiscordBot#6442 Audio status to voice channel ref#6442 Aug 1, 2025
@bryceoj bryceoj changed the title Audio status to voice channel ref#6442 Audio status to voice channel #6442 Aug 1, 2025
@bryceoj bryceoj changed the title Audio status to voice channel #6442 Audio status to voice channel Aug 1, 2025
Copy link
Member

@Jackenmen Jackenmen left a 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:
Copy link
Member

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.

Comment on lines +231 to +244
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)

Copy link
Member

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.

@Flame442 Flame442 added the Type: Enhancement Something meant to enhance existing Red features. label Aug 25, 2025
@rishabhsingroha
Copy link

wow

@NiyahVE
Copy link

NiyahVE commented Oct 19, 2025

Looking forward to this still, nice work :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Category: Cogs - Audio This is related to the Audio cog. Type: Enhancement Something meant to enhance existing Red features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants