Пытался сделать камманду для очистки чата в дискорд получилось не очень
выдаёт ошибку:
File "C:\Users\Seregambo\AppData\Local\Programs\Python\Python311\Lib\site-packages\disnake\ext\commands\slash_core.py", line 732, in invoke
await call_param_func(self.callback, inter, self.cog, **kwargs)
File "C:\Users\Seregambo\AppData\Local\Programs\Python\Python311\Lib\site-packages\disnake\ext\commands\params.py", line 1022, in call_param_func
return await maybe_coroutine(safe_call, function, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Seregambo\AppData\Local\Programs\Python\Python311\Lib\site-packages\disnake\utils.py", line 600, in maybe_coroutine
return await value
^^^^^^^^^^^
File "C:\Users\Seregambo\Desktop\WTF\Новая папка\script.py", line 93, in clear
await ctx.channel.purge ( limit = amount)
File "C:\Users\Seregambo\AppData\Local\Programs\Python\Python311\Lib\site-packages\disnake\channel.py", line 617, in purge
async for message in iterator:
File "C:\Users\Seregambo\AppData\Local\Programs\Python\Python311\Lib\site-packages\disnake\iterators.py", line 117, in __anext__
return await self.next()
^^^^^^^^^^^^^^^^^
File "C:\Users\Seregambo\AppData\Local\Programs\Python\Python311\Lib\site-packages\disnake\iterators.py", line 316, in next
await self.fill_messages()
File "C:\Users\Seregambo\AppData\Local\Programs\Python\Python311\Lib\site-packages\disnake\iterators.py", line 338, in fill_messages
if self._get_retrieve():
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Seregambo\AppData\Local\Programs\Python\Python311\Lib\site-packages\disnake\iterators.py", line 325, in _get_retrieve
if limit is None or limit > 100:
^^^^^^^^^^^
TypeError: '>' not supported between instances of 'str' and 'int'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\Seregambo\AppData\Local\Programs\Python\Python311\Lib\site-packages\disnake\ext\commands\interaction_bot_base.py", line 1377, in process_application_commands
await app_command.invoke(interaction)
File "C:\Users\Seregambo\AppData\Local\Programs\Python\Python311\Lib\site-packages\disnake\ext\commands\slash_core.py", line 741, in invoke
raise CommandInvokeError(exc) from exc
disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: '>' not supported between instances of 'str' and 'int'
Вот код
@bot.slash_command( pass_context = True)
async def clear( ctx, amount = 100):
await ctx.channel.purge ( limit = amount)