Смотрел в доках, интернете. Ответа не получил.
Пожалуйста ответьте, почему msg является None и как это решить?
@Bot.slash_command()
async def tests(ctx):
msg=await ctx.send('hello')
print(msg.content)
Вот ошибка
Ignoring exception in slash command 'tests':
Traceback (most recent call last):
File "C:\Users\ak28r\AppData\Local\Programs\Python\Python38\lib\site-packages\disnake\ext\commands\slash_core.py", line 730, in invoke
await call_param_func(self.callback, inter, self.cog, **kwargs)
File "C:\Users\ak28r\AppData\Local\Programs\Python\Python38\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\ak28r\AppData\Local\Programs\Python\Python38\lib\site-packages\disnake\utils.py", line 599, in maybe_coroutine
return await value
File "c:\Users\ak28r\OneDrive\Рабочий стол\Test\test.py", line 13, in tests
print(msg.content)
AttributeError: 'NoneType' object has no attribute 'content'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\ak28r\AppData\Local\Programs\Python\Python38\lib\site-packages\disnake\ext\commands\interaction_bot_base.py", line 1353, in process_application_commands
await app_command.invoke(interaction)
File "C:\Users\ak28r\AppData\Local\Programs\Python\Python38\lib\site-packages\disnake\ext\commands\slash_core.py", line 739, in invoke
raise CommandInvokeError(exc) from exc
disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'content'
Пробовал дебажить msg, выдает None.