blob: 7b938947f2bbda4615b2264f911c4aaae1e98361 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
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):
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":
YOUTUBE_SUPPORT = False
YOUTUBE_BROKEN = False
return await ctx.send("YouTube has been disabled.")
if action == "enable":
YOUTUBE_SUPPORT = True
YOUTUBE_BROKEN = False
return await ctx.send("YouTube has been enabled.")
if action == "broken":
YOUTUBE_SUPPORT = False
YOUTUBE_BROKEN = True
return await ctx.send("YouTube has been marked as broken.")
async def setup(bot):
await bot.add_cog(Toggle(bot))
|