я создал команду /clear
@bot.command()
async def clear(ctx, amount=50):
await ctx.channel.delete(limit=amount)
но при когда я пишу /clear 5
появляется ошибка
[2023-11-13 15:40:52] [ERROR ] discord.ext.commands.bot: Ignoring exception in command clear
Traceback (most recent call last):
File "C:\Users\daniel\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 235, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\daniel\Documents\Project\Grozny_bot\main.py", line 18, in clear
await ctx.channel.delete(limit=amount)
TypeError: GuildChannel.delete() got an unexpected keyword argument 'limit'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\daniel\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 1350, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\daniel\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 1029, in invoke
await injected(*ctx.args, **ctx.kwargs) # type: ignore
File "C:\Users\daniel\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 244, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: GuildChannel.delete() got an unexpected keyword argument 'limit'