Здравствуйте. Подскажите пожалуйста. Я делаю бота DISCORD. Хочу сделать чтобы при команде /say_text писалось:
Неверное использование! И так далее...
Вот код:
@Bot.command()
async def say_text(ctx, *, arg):
if arg is None:
await ctx.send(embed=discord.Embed(title="Ошибка!", description="Правильное использование:\n/say_text [текст]"))
else:
deleted = await ctx.message.channel.purge(limit=1)
await ctx.send(arg)
Ошибка в консоли:
Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "say" is not found
Ignoring exception in command say_text:
Traceback (most recent call last):
File "C:\Users\ol030\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\ol030\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py", line 855, in invoke
await self.prepare(ctx)
File "C:\Users\ol030\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py", line 789, in prepare
await self._parse_arguments(ctx)
File "C:\Users\ol030\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py", line 706, in _parse_arguments
kwargs[name] = await self.transform(ctx, param)
File "C:\Users\ol030\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py", line 542, in transform
raise MissingRequiredArgument(param)
discord.ext.commands.errors.MissingRequiredArgument: arg is a required argument that is missing.