aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParker <contact@pkrm.dev>2024-04-09 00:19:28 -0500
committerParker <contact@pkrm.dev>2024-04-09 00:19:28 -0500
commitab6d784f2d2390e4d952bf993985b78332ee82f8 (patch)
treed752c10a3248953f4e6fdc9b67774f4ac26ae278
parentecdca1f9dfd141e0c5c2f6968b2c02d2782a59d2 (diff)
Remove YT support
-rw-r--r--code/cogs/play.py29
1 files changed, 20 insertions, 9 deletions
diff --git a/code/cogs/play.py b/code/cogs/play.py
index b61d567..895f5ab 100644
--- a/code/cogs/play.py
+++ b/code/cogs/play.py
@@ -24,23 +24,34 @@ class Play(commands.Cog):
"Play a song from your favorite music provider"
player = self.bot.lavalink.player_manager.get(interaction.guild.id)
+ # Notify users that YouTube and Apple Music links are not allowed
+
+ if "youtube.com" in query or "youtu.be" in query:
+ embed = discord.Embed(
+ title="YouTube Not Supported",
+ description="Unfortunately, YouTube does not allow bots to stream from their platform. Try sending a link for a different platform, or simply type the name of the song and I will automatically find it on a supported platform.",
+ color=BOT_COLOR,
+ )
+ return await interaction.response.send_message(embed=embed)
+
+ if "music.apple.com" in query:
+ embed = discord.Embed(
+ title="Apple Music Not Supported",
+ description="Unfortunately, Apple Music does not allow bots to stream from their platform. Try sending a link for a different platform, or simply type the name of the song and I will automatically find it on a supported platform.",
+ color=BOT_COLOR,
+ )
+ return await interaction.response.send_message(embed=embed)
+
if not url_rx.match(query):
- ytsearch = f"ytsearch:{query}"
+ ytsearch = f"scsearch:{query}"
results = await player.node.get_tracks(ytsearch)
if not results.tracks or results.load_type in (
LoadType.EMPTY,
LoadType.ERROR,
):
- scsearch = f"scsearch:{query}"
+ scsearch = f"dzsearch:{query}"
results = await player.node.get_tracks(scsearch)
-
- if not results.tracks or results.load_type in (
- LoadType.EMPTY,
- LoadType.ERROR,
- ):
- dzsearch = f"dzsearch:{query}"
- results = await player.node.get_tracks(dzsearch)
else:
results = await player.node.get_tracks(query)