coowner.py 文件源码

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

项目:Sitryk-Cogs 作者: Sitryk 项目源码 文件源码
def deluser(self, ctx, user: discord.User, *, command):
        """Removes restriction on [command] for [user]"""

        confirm = await self._confirm_owner(ctx)
        if not confirm:
            return

        if user and user.id in self.settings["USERS"]:
            pass
        else:
            await self.bot.say("That user is not a co-owner.")
            return

        if command in self.settings["USERS"][user.id]["RESTRICTED"]:
            await self.bot.say("**{}** has been removed from {}'s' restricted list".format(command, user.display_name))
            self.settings["USERS"][user.id]["RESTRICTED"].remove(command)
            dataIO.save_json(self.path, self.settings)
        elif command not in self.settings["USERS"][user.id]["RESTRICTED"]:
            await self.bot.say("{} is not a restricted command for {}".format(command, user.display_name))
        else:
            await self.bot.say("{} is not a valid command.".format(command))
        pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号