Owner.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:youtube 作者: FishyFing 项目源码 文件源码
def _reload(self, *, cog_name: str):
        """Reloads a module
        Example: reload audio"""
        module = cog_name.strip()
        if "modules." not in module:
            module = "modules." + module

        try:
            self._unload_cog(module, reloading=True)
        except:
            pass

        try:
            self._load_cog(module)
        except CogNotFoundError:
            await ctx.send("That cog cannot be found.")
        except NoSetupError:
            await ctx.send("That cog does not have a setup function.")
        except CogLoadError as e:
            logger.exception(e)
            traceback.print_exc()
            await ctx.send("That cog could not be loaded. Check your"
                           " console or logs for more information.")
        else:
            set_cog(module, True)
            await self.disable_commands()
            await ctx.send("The cog has been reloaded.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号