mod.py 文件源码

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

项目:dogbot 作者: slice 项目源码 文件源码
def empty_out(self, ctx, *, role: discord.Role):
        """
        Empties out a role's permissions.

        This effectively turn it into a vanity role.
        """
        if role > ctx.guild.me.top_role:
            return await ctx.send('My position on the role hierarchy is lower than that role, so I can\'t edit it.')

        try:
            await role.edit(permissions=discord.Permissions(permissions=0))
            await ctx.ok()
        except discord.Forbidden:
            await ctx.send('I can\'t do that.')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号