1

i get this error when use my command on different users
Command raised an exception: AttributeError: 'NoneType' object has no attribute 'name'

im giving an example, there is a discord server, and server has 5 users. I'm using the command like *sorustur @veinz707 , it works. But in other users it gives error.

the code:

async def sorustur(ctx, *, member: discord.Member):
    member = ctx.author if not member else member
    roles = [role for role in member.roles]
    embed = discord.Embed
    bott = "Değil"
    if not member.bot:
        bott = "Değil"
    else:
        bott = "Bot"
    durum = str(member.status)
    if durum == 'dnd':
        durum = "Rahatsız Etmeyin"
    elif durum == "online":
        durum = "Çevrimiçi"
    elif durum == "idle":
        durum = "Boşta"
    embed = embed(title="Kullanıcı Bilgisi",
                  colour=member.colour,
                  timestamp=datetime.utcnow())
    embed.set_thumbnail(
        url="https://cdn.discordapp.com/attachments/715198493139927154/836224520180334622/basixzhareketli.gif")
    embed.add_field(name="Kullanıcı adı : ", value=str(member), inline=True)
    embed.add_field(name="ID : ", value=member.id, inline=True)
    embed.add_field(name="Bot ? : ", value=bott, inline=True)
    embed.add_field(name="En yetkili rolü : ", value=member.top_role.mention, inline=True)
    embed.add_field(name="Durum : ", value=durum, inline=True)
    embed.add_field(name="Aktivite : ", value=f"{member.activity.name}", inline=True)
    embed.add_field(name="Hesap oluşturma tarihi : ", value=member.created_at.strftime("%d/%m/%Y %H:%M:%S"),
                    inline=True)
    embed.add_field(name="Sunucuya katıldığı tarih : ", value=member.joined_at.strftime("%d/%m/%Y %H:%M:%S"),
                    inline=True)
    embed.add_field(name=f"Rolleri : ", value=f"{len(roles)}", inline=True)

    await ctx.send(content=None, embed=embed)

how can i fix this problem

veinz707
  • 11
  • 2

0 Answers0