diff --git a/cogs/basic.py b/cogs/basic.py index 47ac547..dc98a71 100644 --- a/cogs/basic.py +++ b/cogs/basic.py @@ -122,6 +122,9 @@ class Basic(commands.Cog): @commands.dynamic_cooldown(cooldown_check, commands.BucketType.guild) async def play(self, ctx: commands.Context, *, query: str, start: str = "0", end: str = "0") -> None: "Loads your input into the queue." + if isinstance(ctx, discord.Interaction) and not ctx.interaction.response.is_done(): + await ctx.defer() + player: voicelink.Player = ctx.guild.voice_client if not player: player = await voicelink.connect_channel(ctx) @@ -216,6 +219,9 @@ class Basic(commands.Cog): @commands.dynamic_cooldown(cooldown_check, commands.BucketType.guild) async def search(self, ctx: commands.Context, *, query: str, platform: str = Config().search_platform.name): "Searches your query and displays the results." + if isinstance(ctx, discord.Interaction) and not ctx.interaction.response.is_done(): + await ctx.defer() + player: voicelink.Player = ctx.guild.voice_client if not player: player = await voicelink.connect_channel(ctx) @@ -259,6 +265,9 @@ class Basic(commands.Cog): @commands.dynamic_cooldown(cooldown_check, commands.BucketType.guild) async def playtop(self, ctx: commands.Context, *, query: str, start: str = "0", end: str = "0"): "Adds a song with the given url or query on the top of the queue." + if isinstance(ctx, discord.Interaction) and not ctx.interaction.response.is_done(): + await ctx.defer() + player: voicelink.Player = ctx.guild.voice_client if not player: player = await voicelink.connect_channel(ctx) diff --git a/cogs/playlist.py b/cogs/playlist.py index 4ad9614..9c56596 100644 --- a/cogs/playlist.py +++ b/cogs/playlist.py @@ -86,11 +86,11 @@ async def check_playlist( share_perm: Optional[str] = None ) -> dict: """Get user's playlist data with various filtering options.""" - user_playlists = await MongoDBHandler.get_user(ctx.author.id, d_type='playlist') - if isinstance(ctx, discord.Interaction) and not ctx.interaction.response.is_done(): await ctx.defer() + user_playlists = await MongoDBHandler.get_user(ctx.author.id, d_type='playlist') + if full: return user_playlists