Command raised an exception: TypeError: Member.timeout() got some positional-only arguments passed as keyword arguments: 'until'
Код:
@client.command()
async def timeout(ctx, member:discord.Member, time, reason):
await member.timeout(until=time, reason=reason)
await ctx.send(f'Участник {member.mention} был замучен.\nПричина: {reason}\n\n Замутил администратор: {ctx.message.author.mention}')
Ошибка:
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\forzu\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 1347, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\forzu\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 986, in invoke
await injected(*ctx.args, **ctx.kwargs) # type: ignore
File "C:\Users\forzu\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 199, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: Member.timeout() got some positional-only arguments passed as keyword arguments: 'until'
Ответы (1 шт):
Автор решения: Universall
→ Ссылка
Не
await member.timeout(until=time, reason=reason)
А
await member.timeout(time, reason=reason)
Если перевести ошибку, то всё станет ясно:
несколько позиционных аргументов, переданных в качестве аргументов ключевого слова: 'until'