diff options
author | Parker <contact@pkrm.dev> | 2024-08-24 14:56:51 -0500 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2024-08-24 14:56:51 -0500 |
commit | c62d2306974475aa82da8902dc3c973705588043 (patch) | |
tree | 1a7712aa9fa90212f34b51ab785e3d7af7421e9f /code/cogs | |
parent | 2cdaa11af4ce1a99d7bb51ef311a5262dd656bf1 (diff) |
Make YouTube support optional
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 |