Owner.py 文件源码

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

项目:youtube 作者: FishyFing 项目源码 文件源码
def unload(self, *, cog_name: str):
        """Unloads a module
        Example: unload mod"""
        module = cog_name.strip()
        if "modules." not in module:
            module = "modules." + module
        if not self._does_cogfile_exist(module):
            await ctx.send("That cog file doesn't exist. I will not"
                           " turn off autoloading at start just in case"
                           " this isn't supposed to happen.")
        else:
            set_cog(module, False)
        try:  # No matter what we should try to unload it
            self._unload_cog(module)
        except OwnerUnloadWithoutReloadError:
            await ctx.send("I cannot allow you to unload the Owner plugin"
                           " unless you are in the process of reloading.")
        except CogUnloadError as e:
            logger.exception(e)
            traceback.print_exc()
            await ctx.send('Unable to safely unload that cog.')
        else:
            await ctx.send("The cog has been unloaded.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号