mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-06 17:32:31 -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:
@@ -29,7 +29,7 @@ class Core:
|
||||
async def load(self, ctx, *, cog_name: str):
|
||||
"""Loads a package"""
|
||||
try:
|
||||
spec = ctx.bot.cog_mgr.find_cog(cog_name)
|
||||
spec = await ctx.bot.cog_mgr.find_cog(cog_name)
|
||||
except NoModuleFound:
|
||||
await ctx.send("No module by that name was found in any"
|
||||
" cog path.")
|
||||
@@ -63,7 +63,7 @@ class Core:
|
||||
ctx.bot.unload_extension(cog_name)
|
||||
self.cleanup_and_refresh_modules(cog_name)
|
||||
try:
|
||||
spec = ctx.bot.cog_mgr.find_cog(cog_name)
|
||||
spec = await ctx.bot.cog_mgr.find_cog(cog_name)
|
||||
ctx.bot.load_extension(spec)
|
||||
except Exception as e:
|
||||
log.exception("Package reloading failed", exc_info=e)
|
||||
|
||||
Reference in New Issue
Block a user