mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 11:48:55 -05:00
[3.2.3][Audio] Improved Playlist cooldowns (#3342)
* Improved Playlist cooldowns Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * Improved Playlist cooldowns Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * formatting Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
This commit is contained in:
parent
fe7770c833
commit
9f027cc3e0
2
changelog.d/audio/3342.enhance.1.rst
Normal file
2
changelog.d/audio/3342.enhance.1.rst
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Reduce some cooldowns on playlist commands and stop them triggering before command parsing.
|
||||||
|
|
||||||
@ -4150,8 +4150,8 @@ class Audio(commands.Cog):
|
|||||||
else None,
|
else None,
|
||||||
)
|
)
|
||||||
|
|
||||||
@commands.cooldown(1, 300, commands.BucketType.member)
|
@commands.cooldown(1, 150, commands.BucketType.member)
|
||||||
@playlist.command(name="copy", usage="<id_or_name> [args]")
|
@playlist.command(name="copy", usage="<id_or_name> [args]", cooldown_after_parsing=True)
|
||||||
async def _playlist_copy(
|
async def _playlist_copy(
|
||||||
self,
|
self,
|
||||||
ctx: commands.Context,
|
ctx: commands.Context,
|
||||||
@ -4444,7 +4444,9 @@ class Audio(commands.Cog):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@commands.cooldown(1, 30, commands.BucketType.member)
|
@commands.cooldown(1, 30, commands.BucketType.member)
|
||||||
@playlist.command(name="dedupe", usage="<playlist_name_OR_id> [args]")
|
@playlist.command(
|
||||||
|
name="dedupe", usage="<playlist_name_OR_id> [args]", cooldown_after_parsing=True
|
||||||
|
)
|
||||||
async def _playlist_remdupe(
|
async def _playlist_remdupe(
|
||||||
self,
|
self,
|
||||||
ctx: commands.Context,
|
ctx: commands.Context,
|
||||||
@ -4577,9 +4579,13 @@ class Audio(commands.Cog):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@checks.is_owner()
|
@checks.is_owner()
|
||||||
@playlist.command(name="download", usage="<playlist_name_OR_id> [v2=False] [args]")
|
@playlist.command(
|
||||||
|
name="download",
|
||||||
|
usage="<playlist_name_OR_id> [v2=False] [args]",
|
||||||
|
cooldown_after_parsing=True,
|
||||||
|
)
|
||||||
@commands.bot_has_permissions(attach_files=True)
|
@commands.bot_has_permissions(attach_files=True)
|
||||||
@commands.cooldown(1, 60, commands.BucketType.guild)
|
@commands.cooldown(1, 30, commands.BucketType.guild)
|
||||||
async def _playlist_download(
|
async def _playlist_download(
|
||||||
self,
|
self,
|
||||||
ctx: commands.Context,
|
ctx: commands.Context,
|
||||||
@ -4721,8 +4727,10 @@ class Audio(commands.Cog):
|
|||||||
await ctx.send(file=discord.File(to_write, filename=f"{file_name}.txt"))
|
await ctx.send(file=discord.File(to_write, filename=f"{file_name}.txt"))
|
||||||
to_write.close()
|
to_write.close()
|
||||||
|
|
||||||
@commands.cooldown(1, 20, commands.BucketType.member)
|
@commands.cooldown(1, 10, commands.BucketType.member)
|
||||||
@playlist.command(name="info", usage="<playlist_name_OR_id> [args]")
|
@playlist.command(
|
||||||
|
name="info", usage="<playlist_name_OR_id> [args]", cooldown_after_parsing=True
|
||||||
|
)
|
||||||
async def _playlist_info(
|
async def _playlist_info(
|
||||||
self,
|
self,
|
||||||
ctx: commands.Context,
|
ctx: commands.Context,
|
||||||
@ -4858,8 +4866,8 @@ class Audio(commands.Cog):
|
|||||||
page_list.append(embed)
|
page_list.append(embed)
|
||||||
await menu(ctx, page_list, DEFAULT_CONTROLS)
|
await menu(ctx, page_list, DEFAULT_CONTROLS)
|
||||||
|
|
||||||
@commands.cooldown(1, 30, commands.BucketType.guild)
|
@commands.cooldown(1, 15, commands.BucketType.guild)
|
||||||
@playlist.command(name="list", usage="[args]")
|
@playlist.command(name="list", usage="[args]", cooldown_after_parsing=True)
|
||||||
@commands.bot_has_permissions(add_reactions=True)
|
@commands.bot_has_permissions(add_reactions=True)
|
||||||
async def _playlist_list(self, ctx: commands.Context, *, scope_data: ScopeParser = None):
|
async def _playlist_list(self, ctx: commands.Context, *, scope_data: ScopeParser = None):
|
||||||
"""List saved playlists.
|
"""List saved playlists.
|
||||||
@ -4982,8 +4990,8 @@ class Audio(commands.Cog):
|
|||||||
)
|
)
|
||||||
return embed
|
return embed
|
||||||
|
|
||||||
@playlist.command(name="queue", usage="<name> [args]")
|
@playlist.command(name="queue", usage="<name> [args]", cooldown_after_parsing=True)
|
||||||
@commands.cooldown(1, 600, commands.BucketType.member)
|
@commands.cooldown(1, 300, commands.BucketType.member)
|
||||||
async def _playlist_queue(
|
async def _playlist_queue(
|
||||||
self, ctx: commands.Context, playlist_name: str, *, scope_data: ScopeParser = None
|
self, ctx: commands.Context, playlist_name: str, *, scope_data: ScopeParser = None
|
||||||
):
|
):
|
||||||
@ -5194,8 +5202,8 @@ class Audio(commands.Cog):
|
|||||||
).format(playlist_name=playlist.name, id=playlist.id, scope=scope_name),
|
).format(playlist_name=playlist.name, id=playlist.id, scope=scope_name),
|
||||||
)
|
)
|
||||||
|
|
||||||
@playlist.command(name="save", usage="<name> <url> [args]")
|
@playlist.command(name="save", usage="<name> <url> [args]", cooldown_after_parsing=True)
|
||||||
@commands.cooldown(1, 120, commands.BucketType.member)
|
@commands.cooldown(1, 60, commands.BucketType.member)
|
||||||
async def _playlist_save(
|
async def _playlist_save(
|
||||||
self,
|
self,
|
||||||
ctx: commands.Context,
|
ctx: commands.Context,
|
||||||
@ -5288,8 +5296,13 @@ class Audio(commands.Cog):
|
|||||||
else None,
|
else None,
|
||||||
)
|
)
|
||||||
|
|
||||||
@commands.cooldown(1, 60, commands.BucketType.member)
|
@commands.cooldown(1, 30, commands.BucketType.member)
|
||||||
@playlist.command(name="start", aliases=["play"], usage="<playlist_name_OR_id> [args]")
|
@playlist.command(
|
||||||
|
name="start",
|
||||||
|
aliases=["play"],
|
||||||
|
usage="<playlist_name_OR_id> [args]",
|
||||||
|
cooldown_after_parsing=True,
|
||||||
|
)
|
||||||
async def _playlist_start(
|
async def _playlist_start(
|
||||||
self,
|
self,
|
||||||
ctx: commands.Context,
|
ctx: commands.Context,
|
||||||
@ -5457,7 +5470,9 @@ class Audio(commands.Cog):
|
|||||||
return await ctx.invoke(self.play, query=playlist.url)
|
return await ctx.invoke(self.play, query=playlist.url)
|
||||||
|
|
||||||
@commands.cooldown(1, 60, commands.BucketType.member)
|
@commands.cooldown(1, 60, commands.BucketType.member)
|
||||||
@playlist.command(name="update", usage="<playlist_name_OR_id> [args]")
|
@playlist.command(
|
||||||
|
name="update", usage="<playlist_name_OR_id> [args]", cooldown_after_parsing=True
|
||||||
|
)
|
||||||
async def _playlist_update(
|
async def _playlist_update(
|
||||||
self,
|
self,
|
||||||
ctx: commands.Context,
|
ctx: commands.Context,
|
||||||
@ -5734,7 +5749,9 @@ class Audio(commands.Cog):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@commands.cooldown(1, 60, commands.BucketType.member)
|
@commands.cooldown(1, 60, commands.BucketType.member)
|
||||||
@playlist.command(name="rename", usage="<playlist_name_OR_id> <new_name> [args]")
|
@playlist.command(
|
||||||
|
name="rename", usage="<playlist_name_OR_id> <new_name> [args]", cooldown_after_parsing=True
|
||||||
|
)
|
||||||
async def _playlist_rename(
|
async def _playlist_rename(
|
||||||
self,
|
self,
|
||||||
ctx: commands.Context,
|
ctx: commands.Context,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user