From b343d0d45b0bafadaf2947aef4b2fe2a19d726f5 Mon Sep 17 00:00:00 2001 From: Parker Date: Tue, 25 Mar 2025 23:14:40 -0500 Subject: Better fix --- code/cogs/owner/toggle.py | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'code/cogs/owner/toggle.py') 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)) -- cgit v1.2.3-70-g09d2