2021-07-15 22:54:09 +01:00
|
|
|
import os
|
|
|
|
from dotenv import load_dotenv # Import OS variables from Dotenv file.
|
|
|
|
load_dotenv() # Load Dotenv. Delete this for production
|
|
|
|
import asyncio # Discord Py Dependency
|
|
|
|
import discord # Main Lib
|
|
|
|
from discord.ext import commands # Commands module
|
|
|
|
from discord_slash import SlashCommand, SlashContext, cog_ext, utils # Slash Command Library
|
|
|
|
from discord_slash.utils.manage_commands import create_choice, create_option # Slash Command features
|
|
|
|
|
2021-07-15 23:13:01 +01:00
|
|
|
from bot import loadCog, unloadCog
|
2021-07-15 22:54:09 +01:00
|
|
|
|
2021-07-15 23:13:01 +01:00
|
|
|
##### Dev Cog
|
|
|
|
class Dev(commands.Cog):
|
2021-07-15 22:54:09 +01:00
|
|
|
def __init__(self, client):
|
|
|
|
self.client = client
|
|
|
|
|
|
|
|
@commands.command(
|
|
|
|
name='debug',
|
|
|
|
description='Toggles debug feature for the guild. Enter either `on` or `off`.',
|
|
|
|
brief='Toggle debug features.'
|
|
|
|
)
|
|
|
|
async def _debug(self, ctx, toggle:str):
|
|
|
|
if toggle.lower() == 'on':
|
|
|
|
loadCog(f'./debug/debug.py')
|
|
|
|
await ctx.reply(f'Debug commands enabled. Use them carefully.')
|
|
|
|
elif toggle.lower() == 'off':
|
|
|
|
unloadCog(f'./debug/debug.py')
|
|
|
|
await ctx.reply(f'Debug commands disabled.')
|
|
|
|
|
|
|
|
def setup(client):
|
2021-07-15 23:13:01 +01:00
|
|
|
client.add_cog(Dev(client))
|