mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-05 17:02:32 -05:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec0c71d5c2 | ||
|
|
3eb4017263 | ||
|
|
6b5bcdfe74 | ||
|
|
2bd082e8f2 | ||
|
|
7d36cc8366 | ||
|
|
9fc0e627ee | ||
|
|
989e16b20b | ||
|
|
1c648abea2 |
@@ -173,7 +173,7 @@ class VersionInfo:
|
||||
)
|
||||
|
||||
|
||||
__version__ = "3.1.6"
|
||||
__version__ = "3.1.9"
|
||||
version_info = VersionInfo.from_str(__version__)
|
||||
|
||||
# Filter fuzzywuzzy slow sequence matcher warning
|
||||
|
||||
@@ -1737,6 +1737,9 @@ class Audio(commands.Cog):
|
||||
# YouTube or Soundcloud playlist
|
||||
track_len = 0
|
||||
for track in tracks:
|
||||
if len(player.queue) >= 10000:
|
||||
await ctx.send("I can't add anything else to the queue.")
|
||||
break
|
||||
if guild_data["maxlength"] > 0:
|
||||
if self._track_limit(ctx, track, guild_data["maxlength"]):
|
||||
track_len += 1
|
||||
@@ -1774,11 +1777,15 @@ class Audio(commands.Cog):
|
||||
single_track = tracks[0]
|
||||
if guild_data["maxlength"] > 0:
|
||||
if self._track_limit(ctx, single_track, guild_data["maxlength"]):
|
||||
if len(player.queue) >= 10000:
|
||||
return await ctx.send("I can't add anything else to the queue.")
|
||||
player.add(ctx.author, single_track)
|
||||
else:
|
||||
return await self._embed_msg(ctx, _("Track exceeds maximum length."))
|
||||
|
||||
else:
|
||||
if len(player.queue) >= 10000:
|
||||
return await ctx.send("I can't add anything else to the queue.")
|
||||
player.add(ctx.author, single_track)
|
||||
except IndexError:
|
||||
return await self._embed_msg(
|
||||
@@ -1939,6 +1946,7 @@ class Audio(commands.Cog):
|
||||
"""Playlist configuration options."""
|
||||
pass
|
||||
|
||||
@checks.is_owner()
|
||||
@playlist.command(name="append")
|
||||
async def _playlist_append(self, ctx, playlist_name, *, url):
|
||||
"""Add a track URL, playlist link, or quick search to a playlist.
|
||||
@@ -2066,6 +2074,7 @@ class Audio(commands.Cog):
|
||||
),
|
||||
)
|
||||
|
||||
@checks.is_owner()
|
||||
@playlist.command(name="create")
|
||||
async def _playlist_create(self, ctx, playlist_name):
|
||||
"""Create an empty playlist."""
|
||||
@@ -2139,6 +2148,7 @@ class Audio(commands.Cog):
|
||||
await ctx.send(file=discord.File(to_write, filename=f"{playlist_name}.txt"))
|
||||
to_write.close()
|
||||
|
||||
@checks.is_owner()
|
||||
@playlist.command(name="info")
|
||||
async def _playlist_info(self, ctx, playlist_name):
|
||||
"""Retrieve information from a saved playlist."""
|
||||
@@ -2241,7 +2251,7 @@ class Audio(commands.Cog):
|
||||
)
|
||||
return embed
|
||||
|
||||
@commands.cooldown(1, 15, discord.ext.commands.BucketType.guild)
|
||||
@checks.is_owner()
|
||||
@playlist.command(name="queue")
|
||||
async def _playlist_queue(self, ctx, playlist_name=None):
|
||||
"""Save the queue to a playlist."""
|
||||
@@ -2297,6 +2307,7 @@ class Audio(commands.Cog):
|
||||
),
|
||||
)
|
||||
|
||||
@checks.is_owner()
|
||||
@playlist.command(name="remove")
|
||||
async def _playlist_remove(self, ctx, playlist_name, url):
|
||||
"""Remove a track from a playlist by url."""
|
||||
@@ -2336,6 +2347,7 @@ class Audio(commands.Cog):
|
||||
),
|
||||
)
|
||||
|
||||
@checks.is_owner()
|
||||
@playlist.command(name="save")
|
||||
async def _playlist_save(self, ctx, playlist_name, playlist_url):
|
||||
"""Save a playlist from a url."""
|
||||
@@ -2367,6 +2379,9 @@ class Audio(commands.Cog):
|
||||
try:
|
||||
player = lavalink.get_player(ctx.guild.id)
|
||||
for track in playlists[playlist_name]["tracks"]:
|
||||
if len(player.queue) >= 10000:
|
||||
await ctx.send("I can't add anything else to the queue.")
|
||||
break
|
||||
if track["info"]["uri"].startswith("localtracks/"):
|
||||
if not await self._localtracks_check(ctx):
|
||||
pass
|
||||
@@ -2376,6 +2391,7 @@ class Audio(commands.Cog):
|
||||
if not self._track_limit(ctx, track["info"]["length"], maxlength):
|
||||
continue
|
||||
player.add(author_obj, lavalink.rest_api.Track(data=track))
|
||||
await asyncio.sleep(0)
|
||||
track_len += 1
|
||||
if len(playlists[playlist_name]["tracks"]) > track_len:
|
||||
maxlength_msg = " {bad_tracks} tracks cannot be queued.".format(
|
||||
@@ -3046,6 +3062,9 @@ class Audio(commands.Cog):
|
||||
|
||||
track_len = 0
|
||||
for track in tracks:
|
||||
if len(player.queue) >= 10000:
|
||||
await ctx.send("I can't add anything else to the queue.")
|
||||
break
|
||||
if guild_data["maxlength"] > 0:
|
||||
if self._track_limit(ctx, track, guild_data["maxlength"]):
|
||||
track_len += 1
|
||||
@@ -3053,6 +3072,7 @@ class Audio(commands.Cog):
|
||||
else:
|
||||
track_len += 1
|
||||
player.add(ctx.author, track)
|
||||
await asyncio.sleep(0)
|
||||
if not player.current:
|
||||
await player.play()
|
||||
if len(tracks) > track_len:
|
||||
@@ -3189,10 +3209,14 @@ class Audio(commands.Cog):
|
||||
|
||||
if guild_data["maxlength"] > 0:
|
||||
if self._track_limit(ctx, search_choice.length, guild_data["maxlength"]):
|
||||
if len(player.queue) >= 10000:
|
||||
return await ctx.send("I can't add anything else to the queue.")
|
||||
player.add(ctx.author, search_choice)
|
||||
else:
|
||||
return await self._embed_msg(ctx, _("Track exceeds maximum length."))
|
||||
else:
|
||||
if len(player.queue) >= 10000:
|
||||
return await ctx.send("I can't add anything else to the queue.")
|
||||
player.add(ctx.author, search_choice)
|
||||
if not player.current:
|
||||
await player.play()
|
||||
|
||||
@@ -17,7 +17,7 @@ from redbot.core import data_manager
|
||||
from .errors import LavalinkDownloadFailed
|
||||
|
||||
JAR_VERSION = "3.2.1"
|
||||
JAR_BUILD = 823
|
||||
JAR_BUILD = 846
|
||||
LAVALINK_DOWNLOAD_URL = (
|
||||
f"https://github.com/Cog-Creators/Lavalink-Jars/releases/download/{JAR_VERSION}_{JAR_BUILD}/"
|
||||
f"Lavalink.jar"
|
||||
|
||||
@@ -35,7 +35,7 @@ install_requires =
|
||||
Click==7.0
|
||||
colorama==0.4.1
|
||||
contextlib2==0.5.5
|
||||
discord.py==1.2.4
|
||||
discord.py==1.2.5
|
||||
distro==1.4.0; sys_platform == "linux"
|
||||
fuzzywuzzy==0.17.0
|
||||
idna==2.8
|
||||
@@ -45,7 +45,7 @@ install_requires =
|
||||
Red-Lavalink==0.3.0
|
||||
schema==0.7.0
|
||||
tqdm==4.32.2
|
||||
uvloop==0.12.2; sys_platform != "win32" and platform_python_implementation == "CPython"
|
||||
uvloop==0.14.0; sys_platform != "win32" and platform_python_implementation == "CPython"
|
||||
websockets==6.0
|
||||
yarl==1.3.0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user