diff options
author | Parker <contact@pkrm.dev> | 2025-03-25 23:03:45 -0500 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2025-03-25 23:03:45 -0500 |
commit | e578077df3f9af70befa6fa69d4dfcedb5986ce1 (patch) | |
tree | 53dacb3ff61a955e127bad80798d7517bd397f35 /code/cogs/owner/toggle.py | |
parent | 06034d0b373a9aed5033c2e670950f765e285c2a (diff) |
Add toggle command
Diffstat (limited to 'code/cogs/owner/toggle.py')
-rw-r--r-- | code/cogs/owner/toggle.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/code/cogs/owner/toggle.py b/code/cogs/owner/toggle.py new file mode 100644 index 0000000..2ab6944 --- /dev/null +++ b/code/cogs/owner/toggle.py @@ -0,0 +1,35 @@ +from discord.ext import commands +from typing import Literal + +import utils.config as config + + +class Toggle(commands.Cog): + def __init__(self, bot): + self.bot = bot + + @commands.command() + @commands.dm_only() + @commands.is_owner() + async def toggle( + self, ctx, action: Literal["disable", "enable", "broken"] + ): + """Toggle YouTube links""" + if action == "disable": + config.YOUTUBE_SUPPORT = False + config.YOUTUBE_BROKEN = False + return await ctx.send("YouTube has been disabled.") + + if action == "enable": + config.YOUTUBE_SUPPORT = True + config.YOUTUBE_BROKEN = False + return await ctx.send("YouTube has been enabled.") + + if action == "broken": + config.YOUTUBE_SUPPORT = False + config.YOUTUBE_BROKEN = True + return await ctx.send("YouTube has been marked as broken.") + + +async def setup(bot): + await bot.add_cog(Toggle(bot)) |