Partial migration to dpy, music cog

This commit is contained in:
2022-11-12 19:38:22 +01:00
parent a4986a04fc
commit 9f62a48bbd
15 changed files with 446 additions and 611 deletions
+11 -12
View File
@@ -28,44 +28,44 @@ class OwnerCog(BaseCog):
return content.strip("` \n")
# Hidden means it won't show up on the default help.
@commands.command(name="load", hidden=True, slash_command=False)
@commands.command(name="load", hidden=True)
@commands.is_owner()
async def _cog_load(self, ctx: Context, *, cog: str):
"""Command which Loads a Module."""
try:
self.bot.load_extension(cog)
await self.bot.load_extension(cog)
except Exception as e:
await ctx.send(f"**`ERROR:`** {type(e).__name__} - {e}")
else:
await ctx.send("**`SUCCESS`**")
@commands.command(name="unload", hidden=True, slash_command=False)
@commands.command(name="unload", hidden=True)
@commands.is_owner()
async def _cog_unload(self, ctx, *, cog: str):
"""Command which Unloads a Module."""
try:
self.bot.unload_extension(cog)
await self.bot.unload_extension(cog)
except Exception as e:
await ctx.send(f"**`ERROR:`** {type(e).__name__} - {e}")
else:
await ctx.send("**`SUCCESS`**")
@commands.command(name="reload", hidden=True, slash_command=False)
@commands.command(name="reload", hidden=True)
@commands.is_owner()
async def _cog_reload(self, ctx, *, cog: str):
"""Command which Reloads a Module."""
try:
self.bot.unload_extension(cog)
self.bot.load_extension(cog)
await self.bot.unload_extension(cog)
await self.bot.load_extension(cog)
except Exception as e:
await ctx.send(f"**`ERROR:`** {type(e).__name__} - {e}")
else:
await ctx.send("**`SUCCESS`**")
@commands.command(name="shutdown", hidden=True, slash_command=False)
@commands.command(name="shutdown", hidden=True)
@commands.is_owner()
async def shutdown(self, ctx):
"""Command which shutdowns the bot."""
@@ -77,7 +77,6 @@ class OwnerCog(BaseCog):
hidden=True,
name="eval",
aliases=["evaluate"],
slash_command=False,
)
async def _eval(self, ctx, *, body: str):
env = {
@@ -173,7 +172,7 @@ class OwnerCog(BaseCog):
await ctx.send(embed=ssfooem)
@commands.is_owner()
@commands.command(hidden=True, aliases=["exec"], slash_command=False)
@commands.command(hidden=True, aliases=["exec"])
async def execute(self, ctx, *, text: str):
"""Do a shell command."""
message = await ctx.send(f"Loading...")
@@ -209,5 +208,5 @@ class OwnerCog(BaseCog):
await message.edit(content=f"```fix\n{content}\n```")
def setup(bot: TuneBot):
bot.add_cog(OwnerCog(bot))
async def setup(bot: TuneBot):
await bot.add_cog(OwnerCog(bot))