aboutsummaryrefslogtreecommitdiff
path: root/code/cogs/owner/toggle.py
diff options
context:
space:
mode:
Diffstat (limited to 'code/cogs/owner/toggle.py')
-rw-r--r--code/cogs/owner/toggle.py25
1 files changed, 8 insertions, 17 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))