[Audio] Playlist rewrite #2861
No reviewers
Labels
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot!2861
Loading…
Reference in a new issue
No description provided.
Delete branch "audo_config"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Description of the changes
ctx.message.id), this allows multiple playlist with the same name[p]playlist removenow converts a playlist to a custom one if it was created from a linkGlobalWhich only Bot Owner have edit accessGuildWhich bot owners, DJ, Mods, Admins, Guild Owners, Authors have access toUserwhich bot owner and playlist author have accessPlaylistobjectPlaylistobjects[p]playlist renameadded[p]playlist update(If a playlist has a playlist url saved (non-custom playlist)) will now update the playlist to the latest tracks avaliableWill be working on
Make playlist remember where it was stopped#1544 Will wait for @aikaterna to finish her implementation so that this can be done with the ranking system@aikaterna, I was thinking so improve user help message and functionality and accurary
a converter that parses scope,author,guild all in one go, it would essentially make the commands more complex to run it would be like
[p]set apikeybut for a normal user this wouldn't matter as they would be able to use everything as they did prior to updateOkay, so I had a brief chat with @mikeshardmind about an argparse for these new commands and how it's unlikely to be implemented into core Red without a full review/discussion due to the complexity added.
So wanted to get the conversation started to reach the best possible outcome for these changes.
I propose that we allow argparser for this PR.
Note: The average user would never need to use these as if not provided it will always default to the current Audio behavior seen in 3.1.3 and before for Playlists. However if the user wishes to use a non default scope/settings for playlist this will be when the arpsarser arguments would come in play.
Arguments
--scope <user|global|guild>--author [id|name]=ctx.author--guild [id|name]=ctx.guildBenefits
[p]help playlistto stay simple where the breakdown of the argparser is done in the additional infoOptional[]=None, However this could cause problem (If a user/server name is the same name as a playlist as an example)easilyallow users to access different scopes, such as get info/play another users playlist in theUSERorGLOBALscope with a simple argument--scope user|globalctx.author,ctx.guild,GUILD scope--authoror--guildare invalid it defaults toctx.author,ctx.guild,Less positive implications
Given the benefits and how your everyday user will not need to use it due to defaults I think this change would be beneficial as it improves usability for advanced users who wish to use the multi scope functionally that this PR adds
@jack1142 Suggested splitting up the commands into groups but this can be cumbersome and make it more difficult to maintain
It's a great Idea if we can figure out a way to make groups take arguments
Just wanted to put it in the radar of anyone viewing/reviewing this PR.
Yeah, so while there was a chance to make groups take arguments (not ideal but I think we could work with it), I gave up on this when it turned out that subcommand's help doesn't show group's args, which makes this pointless. There's just no good way to get help to show group's syntax in a subcommand's help.
So, while I would love to not add argparser, especially for commands that are gonna be used by regular users, I just can't think of a way to do it differently.
On the topic of the argparse converters:
I'm personally fine with them being used, so long as errors about misuse clearly communicate how they should be used, and that they aren't over-used.
They should be used only where it makes the usage easier the majority of the time.
(an example against this) Anything which only has a single switch type should just split logic into command groups.
Okay, so while this is not at all suitable for Core because it has its flaws (it subclasses
Commandto replaceCommand.qualified_nameso that HelpFormatter can properly show usage), if anyone wants to play with group arguments, here's code that they can try using lolMarking this as Ready for review, however I may or may not do some tweaks to this one to reflect @aikaterna 's PRs If those get released before this one if fully reviewed.
Given the complexity of
argparserI attempted to give very clear and direct errors messages if the user tried to use argparser as part of the commands. (Note: All user facing commands do not require any arg parsing unless they wish to change scopes, guild, author. The Only exception of this is[p]playlist copywhich requires argparse for it to work due to the complexity of multiple scopes)This is what this PR looks like when a user tried to user the new arguments incorrectly.
Context help will have a full break down of the command.
If the user gives an invalid input to the commands:
If the user doesn't use
argparserthen the default behaviour is the same as the behaviour prior to this being mergedSuperseded by #2904
Pull request closed