Я столкнулся с проблемой,
class t(discord.ui.View):
def __init__(self):
super().__init__(timeout=human.parse_timespan("5d"))
self.value = Optional[bool]
@discord.ui.button(label="Test", style=discord.ButtonStyle.green, emoji="🔥")
async def Test(self, button: discord.ui.Button, inter: discord.MessageInteraction):
await inter.response.send(ctx.author.id)
self.value = True
self.stop()
Это мой код (тест код) При таком коде у меня ошибки:
Ignoring exception in command tet:
Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/disnake/ext/commands/core.py", line 173, in wrapped
ret = await coro(*args, **kwargs)
File "<string>", line 657, in tet
TypeError: object method can't be used in 'await' expression
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/disnake/ext/commands/bot_base.py", line 591, in invoke
await ctx.command.invoke(ctx)
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/disnake/ext/commands/core.py", line 914, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/disnake/ext/commands/core.py", line 182, in wrapped
raise CommandInvokeError(exc) from exc
disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: object method can't be used in 'await' expression
Ignoring exception in view <t timeout=432000.0 children=1> for item <Button style=<ButtonStyle.success: 3> url=None disabled=False label='Test' emoji=<PartialEmoji animated=False name='🔥' id=None> row=None>:
Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/disnake/ui/view.py", line 385, in _scheduled_task
await item.callback(interaction)
File "<string>", line 190, in Test
AttributeError: 'InteractionResponse' object has no attribute 'send'
И да я писал код на disnake
import disnake as discord