blob: fa6b24de69be663772be10b072c218a10ae7af6d (
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
36
|
from discord.ext import commands
from global_variables import BOT_COLOR
class ReloadCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
@commands.dm_only()
@commands.is_owner()
async def reloadcog(self, ctx: commands.Context, cog: str = None):
if not cog:
return await ctx.send("No cog provided.")
cog = cog.lower()
await self.bot.reload_extension(f"cogs.{cog}")
await ctx.send(f"Cog {cog} has been reloaded")
@commands.command()
@commands.dm_only()
@commands.is_owner()
async def loadcog(self, ctx: commands.Context, cog: str = None):
if not cog:
return await ctx.send("No cog provided.")
cog = cog.lower()
await self.bot.load_extension(f"cogs.{cog}")
await ctx.send(f"Cog {cog} has been loaded")
async def setup(bot):
await bot.add_cog(ReloadCog(bot))
|