Skip to content

Conversation

@jimmytruth
Copy link

@jimmytruth jimmytruth commented Oct 16, 2025

It'll be so great if instead of getting info through user messages channel messages would be better to inform everyone in a channel what requested and what played, and if there is nothing to be played and so on

1. A channel message is sent when a track is requested (e.g., when a query, URL, or track selection is initiated).
2. A channel message is sent when the track starts playing (or confirms playback).

The changes focus on ensuring that channel messages are sent when a track is requested and when it is playing for all commands that initiate playback. Below are the specific modifications:
1. PlayPauseCommand:
• Request: Already had a message for when a query is provided: "{nickname} requested {request}".
• Playing: Already sent "Playing {track_list[0].name}" when a query results in a track. Added messages for play/pause toggling:
• When pausing: "Paused playback".
• When resuming from paused: "Playing {self.player.track.name}".
• When nothing is playing: "Nothing is playing".
2. PlayUrlCommand:
• Request: Already had "{nickname} requested playing from a URL".
• Playing: Modified to send "Playing {tracks[0].name}" (or the URL if no name is available) after successfully starting playback.
3. NextTrackCommand:
• Request: Added "{nickname} requested the next track" before attempting to play the next track.
• Playing: Already had "Playing {self.player.track.name}" on success.
4. PreviousTrackCommand:
• Request: Added "{nickname} requested the previous track" before attempting to play the previous track.
• Playing: Already had "Playing {self.player.track.name}" on success.
5. SelectTrackCommand:
• Request: Added "{nickname} requested track number {number}" when a track number is provided.
• Playing: Already had "Playing {arg} {self.player.track.name}" on successful track selection.
6. FavoritesCommand (specifically _play method):
• Request: Added "{nickname} requested favorite track number {number}" when a track number is provided.
• Playing: Added "Playing {self.player.track.name}" after successfully playing the favorite track.
7. RecentsCommand:
• Request: Added "{nickname} requested recent track number {number}" when a track number is provided.
• Playing: Added "Playing {self.player.track.name}" after successfully playing the recent track.
Additional Notes
• Consistency with send_channel_messages: All new messages respect the self.config.general.send_channel_messages configuration, ensuring messages are only sent if enabled.
• No User Messages: The script continues to send all messages to the channel (type=2) and returns None to avoid direct user messaging, as per the previous modification.
• Error Handling: Error messages (e.g., "Nothing is playing", "Out of list") remain as channel messages, unchanged unless necessary.
• Non-Playback Commands: Commands like HelpCommand, AboutCommand, StopCommand, VolumeCommand, SeekBackCommand, SeekForwardCommand, ModeCommand, ServiceCommand, GetLinkCommand, and DownloadCommand were not modified for request/play messages since they do not initiate track playback. However, VolumeCommand and SpeedCommand were updated to include confirmation messages for setting volume/speed for consistency.
• Assumption: The self.player.play method is assumed to set self.player.track.name correctly when playback starts, allowing the "Playing" messages to use the current track's name.
This modified script ensures that for all playback-related commands, a channel message is sent when a track is requested and when it starts playing, while maintaining the requirement to only send channel messages and respecting the existing configuration.
@jimmytruth jimmytruth marked this pull request as draft October 17, 2025 00:11
@jimmytruth jimmytruth marked this pull request as ready for review October 17, 2025 00:11
@jimmytruth jimmytruth marked this pull request as draft October 17, 2025 00:20
@jimmytruth jimmytruth marked this pull request as ready for review October 17, 2025 00:30
Added a workaround if you aren't in a proxy, a patch to remove Proxy since it isn't compatible with the latest version of HTTPX and if you don't prefer to downgrade
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.

1 participant