anime.py 文件源码

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

项目:discord_bot 作者: Der-Eddy 项目源码 文件源码
def nsfw(self, ctx):
        '''Vergibt die Rolle um auf die NSFW Channel zugreifen zu können'''
        if ctx.guild.id == loadconfig.__botserverid__:
            if loadconfig.__selfassignrole__:
                role = discord.utils.get(ctx.guild.roles, name=loadconfig.__selfassignrole__)
                if role in ctx.author.roles:
                    try:
                        await ctx.author.remove_roles(role)
                    except:
                        pass
                    tmp = await ctx.send(f':x: Rolle **{role}** wurde entfernt')
                else:
                    try:
                        await ctx.author.add_roles(role)
                    except:
                        pass
                    tmp = await ctx.send(f':white_check_mark: Rolle **{role}** wurde hinzugefügt')
            else:
                tmp = await ctx.send('**:no_entry:** Es wurde keine Rolle für den Bot eingestellt! Wende dich bitte an den Bot Admin')
        else:
            tmp = await ctx.send(f'**:no_entry:** This command don\'t work on this server!')
        await asyncio.sleep(2 * 60)
        await tmp.delete()
        await ctx.message.delete()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号