update for user commands to have channel messages mainly instead of user messages#134
Open
jimmytruth wants to merge 6 commits into
Open
update for user commands to have channel messages mainly instead of user messages#134jimmytruth wants to merge 6 commits into
jimmytruth wants to merge 6 commits into
Conversation
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.
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
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.
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