cogs fuckery (i have zero clue how this is supposed to work you're on your own for this one glitch)
This commit is contained in:
parent
c3114639a2
commit
fbfa27c979
5 changed files with 296 additions and 15 deletions
|
|
@ -62,4 +62,70 @@ class AdminCommands:
|
|||
save_tracked_channels(self.bot.tracked_channels)
|
||||
await message.reply(f"Stopped tracking messages in {message.channel.name}.", silent=True)
|
||||
else:
|
||||
await message.reply("This channel is not being tracked.", silent=True)
|
||||
await message.reply("This channel is not being tracked.", silent=True)
|
||||
|
||||
async def cmd_loadcog(self, message):
|
||||
"""
|
||||
Load a cog
|
||||
Usage: .loadcog <cog_name>
|
||||
"""
|
||||
content = message.content.strip()
|
||||
parts = content.split()
|
||||
|
||||
if len(parts) != 2:
|
||||
await message.edit(content="❌ Usage: `.loadcog <cog_name>`")
|
||||
return
|
||||
|
||||
cog_name = parts[1]
|
||||
if self.bot.cog_manager.load_cog(cog_name):
|
||||
await message.edit(content=f"✅ Loaded cog: `{cog_name}`")
|
||||
else:
|
||||
await message.edit(content=f"❌ Failed to load cog: `{cog_name}`")
|
||||
|
||||
async def cmd_unloadcog(self, message):
|
||||
"""
|
||||
Unload a cog
|
||||
Usage: .unloadcog <cog_name>
|
||||
"""
|
||||
content = message.content.strip()
|
||||
parts = content.split()
|
||||
|
||||
if len(parts) != 2:
|
||||
await message.edit(content="❌ Usage: `.unloadcog <cog_name>`")
|
||||
return
|
||||
|
||||
cog_name = parts[1]
|
||||
if self.bot.cog_manager.unload_cog(cog_name):
|
||||
await message.edit(content=f"✅ Unloaded cog: `{cog_name}`")
|
||||
else:
|
||||
await message.edit(content=f"❌ Failed to unload cog: `{cog_name}`")
|
||||
|
||||
async def cmd_reloadcog(self, message):
|
||||
"""
|
||||
Reload a cog
|
||||
Usage: .reloadcog <cog_name>
|
||||
"""
|
||||
content = message.content.strip()
|
||||
parts = content.split()
|
||||
|
||||
if len(parts) != 2:
|
||||
await message.edit(content="❌ Usage: `.reloadcog <cog_name>`")
|
||||
return
|
||||
|
||||
cog_name = parts[1]
|
||||
if self.bot.cog_manager.reload_cog(cog_name):
|
||||
await message.edit(content=f"✅ Reloaded cog: `{cog_name}`")
|
||||
else:
|
||||
await message.edit(content=f"❌ Failed to reload cog: `{cog_name}`")
|
||||
|
||||
async def cmd_listcogs(self, message):
|
||||
"""
|
||||
List all loaded cogs
|
||||
Usage: .listcogs
|
||||
"""
|
||||
if not self.bot.cog_manager.cogs:
|
||||
await message.edit(content="No cogs are currently loaded.")
|
||||
return
|
||||
|
||||
cog_list = "\n".join(f"• {name}" for name in sorted(self.bot.cog_manager.cogs.keys()))
|
||||
await message.edit(content=f"**Loaded Cogs:**\n{cog_list}")
|
||||
Loading…
Add table
Add a link
Reference in a new issue