diff --git a/redbot/cogs/audio/core/abc.py b/redbot/cogs/audio/core/abc.py index 2ad4f36ba..f99069ca4 100644 --- a/redbot/cogs/audio/core/abc.py +++ b/redbot/cogs/audio/core/abc.py @@ -322,7 +322,13 @@ class MixinMeta(ABC): @abstractmethod async def can_manage_playlist( - self, scope: str, playlist: "Playlist", ctx: commands.Context, user, guild + self, + scope: str, + playlist: "Playlist", + ctx: commands.Context, + user, + guild, + bypass: bool = False, ) -> bool: raise NotImplementedError() diff --git a/redbot/cogs/audio/core/commands/playlists.py b/redbot/cogs/audio/core/commands/playlists.py index 08d8d3ca8..f8dbfafea 100644 --- a/redbot/cogs/audio/core/commands/playlists.py +++ b/redbot/cogs/audio/core/commands/playlists.py @@ -1676,9 +1676,11 @@ class PlaylistCommands(MixinMeta, metaclass=CompositeMetaClass): ctx.command.reset_cooldown(ctx) return try: - if not await self.can_manage_playlist(scope, playlist, ctx, author, guild): + if not await self.can_manage_playlist( + scope, playlist, ctx, author, guild, bypass=True + ): return - if playlist.url or playlist.id == 42069: + if playlist.url or getattr(playlist, "id", 0) == 42069: player = lavalink.get_player(ctx.guild.id) added, removed, playlist = await self._maybe_update_playlist( ctx, player, playlist diff --git a/redbot/cogs/audio/core/utilities/playlists.py b/redbot/cogs/audio/core/utilities/playlists.py index 00baff6c3..8195ffd7a 100644 --- a/redbot/cogs/audio/core/utilities/playlists.py +++ b/redbot/cogs/audio/core/utilities/playlists.py @@ -39,7 +39,13 @@ CURRATED_DATA = ( class PlaylistUtilities(MixinMeta, metaclass=CompositeMetaClass): async def can_manage_playlist( - self, scope: str, playlist: Playlist, ctx: commands.Context, user, guild + self, + scope: str, + playlist: Playlist, + ctx: commands.Context, + user, + guild, + bypass: bool = False, ) -> bool: is_owner = await self.bot.is_owner(ctx.author) has_perms = False @@ -54,8 +60,9 @@ class PlaylistUtilities(MixinMeta, metaclass=CompositeMetaClass): is_different_user = len({playlist.author, user_to_query.id, ctx.author.id}) != 1 is_different_guild = True if guild_to_query is None else ctx.guild.id != guild_to_query.id - - if is_owner: + if getattr(playlist, "id", 0) == 42069: + has_perms = bypass + elif is_owner: has_perms = True elif playlist.scope == PlaylistScope.USER.value: if not is_different_user: @@ -476,7 +483,7 @@ class PlaylistUtilities(MixinMeta, metaclass=CompositeMetaClass): async def _maybe_update_playlist( self, ctx: commands.Context, player: lavalink.player_manager.Player, playlist: Playlist ) -> Tuple[List[lavalink.Track], List[lavalink.Track], Playlist]: - if playlist.id == 42069: + if getattr(playlist, "id", 0) == 42069: _, updated_tracks = await self._get_bundled_playlist_tracks() results = {} old_tracks = playlist.tracks_obj