diff --git a/redbot/cogs/audio/audio.py b/redbot/cogs/audio/audio.py index d2aa0a83d..7237d7aa4 100644 --- a/redbot/cogs/audio/audio.py +++ b/redbot/cogs/audio/audio.py @@ -714,6 +714,7 @@ class Audio: return await self._embed_msg( ctx, "Playlist name already exists, try again with a different name." ) + playlist_name = playlist_name.split(" ")[0].strip('"') playlist_list = self._to_json(ctx, None, None) async with self.config.guild(ctx.guild).playlists() as playlists: playlists[playlist_name] = playlist_list @@ -775,6 +776,7 @@ class Audio: ) await ctx.send(embed=embed) + @commands.cooldown(1, 15, discord.ext.commands.BucketType.guild) @playlist.command(name="queue") async def _playlist_queue(self, ctx, playlist_name=None): """Save the queue to a playlist.""" @@ -801,11 +803,11 @@ class Audio: await self._embed_msg(ctx, "Please enter a name for this playlist.") def check(m): - return m.author == ctx.author + return m.author == ctx.author and not m.content.startswith(ctx.prefix) try: playlist_name_msg = await ctx.bot.wait_for("message", timeout=15.0, check=check) - playlist_name = str(playlist_name_msg.content) + playlist_name = playlist_name_msg.content.split(" ")[0].strip('"') if len(playlist_name) > 20: return await self._embed_msg(ctx, "Try the command again with a shorter name.") if playlist_name in playlists: @@ -816,11 +818,12 @@ class Audio: return await self._embed_msg(ctx, "No playlist name entered, try again later.") playlist_list = self._to_json(ctx, None, tracklist) async with self.config.guild(ctx.guild).playlists() as playlists: + playlist_name = playlist_name.split(" ")[0].strip('"') playlists[playlist_name] = playlist_list await self._embed_msg( ctx, "Playlist {} saved from current queue: {} tracks added.".format( - playlist_name, len(tracklist) + playlist_name.split(" ")[0].strip('"'), len(tracklist) ), ) @@ -868,6 +871,7 @@ class Audio: playlist_list = self._to_json(ctx, playlist_url, tracklist) if tracklist is not None: async with self.config.guild(ctx.guild).playlists() as playlists: + playlist_name = playlist_name.split(" ")[0].strip('"') playlists[playlist_name] = playlist_list return await self._embed_msg( ctx,