pycord发送discord.ui.View对象到特定频道



我正在尝试将View对象发送到特定频道。我试过这个:

@bot.event
async def on_ready():
ch = _bot.get_channel(927913185766436885)
await ch.purge(limit = 100)
v = discord.ui.View()
v.add_item(Vrb())
await ch.send(view=v)

在ch.send的提示中有view,但当我把view=v放到ch.send时,它会引发:

Traceback (most recent call last):
File "C:UsersCENSOREDAppDataLocalProgramsPythonPython39libsite-packagesdiscordclient.py", line 352, in _run_event
await coro(*args, **kwargs)
File "CENSORED", line 2344, in on_ready
await ch.send(view=v)
File "C:UsersCENSOREDAppDataLocalProgramsPythonPython39libsite-packagesdiscord_componentsdpy_overrides.py", line 350, in send_override
return await send(channel, *args, **kwargs)
TypeError: send() got an unexpected keyword argument 'view'

我该怎么解决这个问题?

我不想使用斜杠命令或其他东西

编辑:我使用的是py-cord-2.0.0a4739+g128a9e97版本。

卸载disconce.py或任何其他disconce.pyfork(如果有(,然后安装Pycord的开发版本。

pip install -U git+https://github.com/Pycord-Development/pycord

最新更新