diff options
author | Parker <contact@pkrm.dev> | 2024-08-24 19:59:08 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-24 19:59:08 +0000 |
commit | bde38c3a71f4e208a2fd1624ea85d8d94cfad3a7 (patch) | |
tree | 83a0f2210171995796b87443be71fb7cc61a5774 /code/cogs | |
parent | c8facd013d9b285c2d24f5b0c127e326bdfa4282 (diff) | |
parent | 7724cfdca43a85dfc53d50f2f164334625cd9a30 (diff) |
Merge pull request #5 from PacketParker/dev
Optional YouTube support
Diffstat (limited to 'code/cogs')
-rw-r--r-- | code/cogs/play.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/code/cogs/play.py b/code/cogs/play.py index fdd0233..3c60633 100644 --- a/code/cogs/play.py +++ b/code/cogs/play.py @@ -7,7 +7,7 @@ import re import requests from cogs.music import Music, LavalinkVoiceClient -from utils.config import BOT_COLOR +from utils.config import BOT_COLOR, YOUTUBE_SUPPORT from utils.custom_sources import SpotifySource, AppleSource @@ -25,15 +25,15 @@ 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 links are not allowed - + # Notify users that YouTube links are not allowed if YouTube support is disabled 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, ephemeral=True) + if not YOUTUBE_SUPPORT: + 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, ephemeral=True) ### ### APPLE MUSIC links, perform API requests and load all tracks from the playlist/album/track |