[Audio] Disallow all users from modifying Playlist 42069. #5018

Merged
Drapersniper merged 4 commits from audio_42069_special_perms into V3/develop 2021-05-19 12:41:52 +02:00
Drapersniper commented 2021-04-30 12:51:45 +02:00 (Migrated from github.com)

As the title states, users should not manually edit this playlist, specially delete it, even though it comes back on next cog reload/bot restart it may leave the bot in a unsupported state as the presence of this playlist is mandatory, if autoplay is expected to work.

As the title states, users should not manually edit this playlist, specially delete it, even though it comes back on next cog reload/bot restart it may leave the bot in a unsupported state as the presence of this playlist is mandatory, if autoplay is expected to work.
aikaterna (Migrated from github.com) reviewed 2021-04-30 12:51:45 +02:00
Jackenmen (Migrated from github.com) requested changes 2021-05-19 00:48:53 +02:00
Jackenmen (Migrated from github.com) left a comment

It seems unnecessary to pass bypass=False everywhere considering it's the default.

It seems unnecessary to pass `bypass=False` everywhere considering it's the default.
Drapersniper commented 2021-05-19 00:50:30 +02:00 (Migrated from github.com)

It seems unnecessary to pass bypass=False everywhere considering it's the default.

You've missed https://github.com/Cog-Creators/Red-DiscordBot/pull/5018/files#diff-bd87e54068100b18833ef1210198b0be47138aa7f667fca5876412c625399e88R1694

and Im dumb...

> It seems unnecessary to pass `bypass=False` everywhere considering it's the default. You've missed https://github.com/Cog-Creators/Red-DiscordBot/pull/5018/files#diff-bd87e54068100b18833ef1210198b0be47138aa7f667fca5876412c625399e88R1694 and Im dumb...
Jackenmen (Migrated from github.com) requested changes 2021-05-19 01:05:58 +02:00
Jackenmen (Migrated from github.com) left a comment

I see that you changed playlist.id to getattr(playlist, "id", 0). From what I can see Playlist object will always have the id attr, which suggests that the playlist variable might not be a Playlist object. If that can indeed happen, then the type hints should be updated appropriately.

Also this change with getattr() doesn't really seem that related to this PR's real purpose which is fixing the stuff with playlist 42069...

I see that you changed `playlist.id` to `getattr(playlist, "id", 0)`. From what I can see `Playlist` object will always have the `id` attr, which suggests that the `playlist` variable might not be a `Playlist` object. If that can indeed happen, then the type hints should be updated appropriately. Also this change with `getattr()` doesn't really seem that related to this PR's real purpose which is fixing the stuff with playlist 42069...
Drapersniper commented 2021-05-19 01:11:37 +02:00 (Migrated from github.com)

It can be a SimpleNamesace when mocked.

It can be a SimpleNamesace when mocked.
Jackenmen (Migrated from github.com) approved these changes 2021-05-19 11:49:17 +02:00
Jackenmen (Migrated from github.com) left a comment

The error message is IMO not ideal but it's the simplest way to fix this so I think it's good enough until proven otherwise.
image

The error message is IMO not ideal but it's the simplest way to fix this so I think it's good enough until proven otherwise. ![image](https://user-images.githubusercontent.com/6032823/118792730-3b0a4280-b898-11eb-81f2-4c82a3b29b0c.png)
Drapersniper commented 2021-05-19 12:41:27 +02:00 (Migrated from github.com)

I've filed #5052 to track it.

I've filed #5052 to track it.
Sign in to join this conversation.
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
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot!5018
No description provided.