Не работает кусок кода:
@bot.command()
async def status(self, ctx: discord.ext.commands.Context):
uptime_timedelta: datetime.timedelta = datetime.datetime.today() - self.start_time
uptime = str(uptime_timedelta).split(".")[0]
server_uptime = datetime.datetime.fromtimestamp(psutil.boot_time())
embed = discord.Embed(title=f"Статус ABot",
colour=discord.Color.purple())
embed.add_field(name="Версия Python", value=sys.version[:3])
embed.add_field(name="Версия discord.py", value=discord.__version__)
embed.add_field(name="Uptime", value=uptime)
embed.add_field(name="Информация о сервере", value=f"Загрузка ЦП: `{psutil.cpu_percent(interval=None)}%`\n"
f"RAM: `{psutil.virtual_memory().used//1024//1024} МБ`/`{psutil.virtual_memory().total//1024//1024} МБ`\n"
f"Uptime: `{str(datetime.datetime.today() - server_uptime).split('.')[0]}`")
await ctx.send(embed=embed)
В ответ получаю ошибку:
Ignoring exception in command status:
Traceback (most recent call last):
File "C:\Users\kps4\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\kps4\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 855, in invoke
await self.prepare(ctx)
File "C:\Users\kps4\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 789, in prepare
await self._parse_arguments(ctx)
File "C:\Users\kps4\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 697, in _parse_arguments
transformed = await self.transform(ctx, param)
File "C:\Users\kps4\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 542, in transform
raise MissingRequiredArgument(param)
discord.ext.commands.errors.MissingRequiredArgument: ctx is a required argument that is missing.