Я создаю дискорд бота и при выводе информации о разбане в embed, выдает ошибку Command raised an exception: AttributeError: 'str' object has no attribute 'name'
@bot.command(pass_context = True)
@commands.has_permissions(view_audit_log=True)
async def unban(ctx,*,member):
await ctx.channel.purge(limit = 1)
emb = discord.Embed (title = 'Unban :unlock:', colour = 15105570)
banned_users = await ctx.guild.bans()
for ban_entry in banned_users:
user = ban_entry.user
await ctx.guild.unban (user)
emb = discord.Embed (title = 'Unban :lock:', colour = 15105570)
emb.set_author (name = member.name, icon_url = member.avatar_url)
emb.add_field (name = 'Ban user', value = 'Baned user : {}'.format(member.mention))
emb.set_footer (text = 'Был заблокирован администратором {}'.format (ctx.author.name), icon_url = ctx.author.avatar_url)
await ctx.send( embed = emb)
В консоли выдает это
Ignoring exception in command unban:
Traceback (most recent call last):
File "C:\Users\alopa\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "E:\Новая папка (2)\main.py", line 74, in unban
emb.set_author (name = member.name, icon_url = member.avatar_url)
AttributeError: 'str' object has no attribute 'name'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\alopa\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\alopa\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\alopa\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'str' object has no attribute 'name'
Прошу помогите!