mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-06 09:22:31 -05:00
[Core] Save package status and restore it on boot
Also better error handling on package loading
This commit is contained in:
@@ -65,6 +65,13 @@ class Red(commands.Bot):
|
||||
"""Lists packages present in the cogs the folder"""
|
||||
return os.listdir("cogs")
|
||||
|
||||
def save_packages_status(self):
|
||||
loaded = []
|
||||
for package in self.extensions:
|
||||
if package.startswith("cogs."):
|
||||
loaded.append(package)
|
||||
self.db.set_global("packages", loaded)
|
||||
|
||||
|
||||
class ExitCodes(Enum):
|
||||
CRITICAL = 1
|
||||
|
||||
Reference in New Issue
Block a user