diff options
author | Parker <contact@pkrm.dev> | 2025-03-25 23:14:40 -0500 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2025-03-25 23:14:40 -0500 |
commit | b343d0d45b0bafadaf2947aef4b2fe2a19d726f5 (patch) | |
tree | b2db2af282fe70939de1748d24af7ca73f50c73b /code/cogs | |
parent | 106692551b83e0cadea30be7664e17363e1061dd (diff) |
Better fix
Diffstat (limited to 'code/cogs')
-rw-r--r-- | code/cogs/owner/toggle.py | 25 | ||||
-rw-r--r-- | code/cogs/play.py | 4 |
2 files changed, 10 insertions, 19 deletions
diff --git a/code/cogs/owner/toggle.py b/code/cogs/owner/toggle.py index 7b93894..a276b01 100644 --- a/code/cogs/owner/toggle.py +++ b/code/cogs/owner/toggle.py @@ -1,8 +1,6 @@ from discord.ext import commands from typing import Literal -from utils.config import YOUTUBE_SUPPORT, YOUTUBE_BROKEN - class Toggle(commands.Cog): def __init__(self, bot): @@ -11,25 +9,18 @@ class Toggle(commands.Cog): @commands.command() @commands.dm_only() @commands.is_owner() - async def toggle( - self, ctx, action: Literal["disable", "enable", "broken"] - ): - """Toggle YouTube links""" - if action == "disable": - YOUTUBE_SUPPORT = False - YOUTUBE_BROKEN = False - return await ctx.send("YouTube has been disabled.") - - if action == "enable": - YOUTUBE_SUPPORT = True - YOUTUBE_BROKEN = False + async def toggle(self, ctx, action: Literal["on", "off"]): + """Toggle YouTube as broken or not""" + if action == "on": + self.bot.youtube_broken = False return await ctx.send("YouTube has been enabled.") - if action == "broken": - YOUTUBE_SUPPORT = False - YOUTUBE_BROKEN = True + if action == "off": + self.bot.youtube_broken = True return await ctx.send("YouTube has been marked as broken.") + await ctx.send("Invalid action. Please use 'on' or 'off'.") + async def setup(bot): await bot.add_cog(Toggle(bot)) diff --git a/code/cogs/play.py b/code/cogs/play.py index 5ff1eb6..1adee12 100644 --- a/code/cogs/play.py +++ b/code/cogs/play.py @@ -6,7 +6,7 @@ from lavalink import LoadType import re from cogs.music import Music, LavalinkVoiceClient -from utils.config import YOUTUBE_SUPPORT, YOUTUBE_BROKEN, create_embed +from utils.config import YOUTUBE_SUPPORT, create_embed from utils.custom_sources import ( LoadError, CustomAudioTrack, @@ -45,7 +45,7 @@ class Play(commands.Cog): embed=embed, ephemeral=True ) - if YOUTUBE_BROKEN: + if self.bot.youtube_broken: embed = create_embed( title="YouTube Broken", description=( |