mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-07 09:52:30 -05:00
[Config] Asynchronous getters (#907)
* Make config get async * Asyncify alias * Asyncify bank * Asyncify cog manager * IT BOOTS * Asyncify core commands * Asyncify repo manager * Asyncify downloader * Asyncify economy * Asyncify alias TESTS * Asyncify economy TESTS * Asyncify downloader TESTS * Asyncify config TESTS * A bank thing * Asyncify Bank cog * Warning message in docs * Update docs with await syntax * Update docs with await syntax
This commit is contained in:
@@ -34,11 +34,11 @@ def init_events(bot, cli_flags):
|
||||
if cli_flags.no_cogs is False:
|
||||
print("Loading packages...")
|
||||
failed = []
|
||||
packages = bot.db.packages()
|
||||
packages = await bot.db.packages()
|
||||
|
||||
for package in packages:
|
||||
try:
|
||||
spec = bot.cog_mgr.find_cog(package)
|
||||
spec = await bot.cog_mgr.find_cog(package)
|
||||
bot.load_extension(spec)
|
||||
except Exception as e:
|
||||
log.exception("Failed to load package {}".format(package),
|
||||
|
||||
Reference in New Issue
Block a user