使用interaction.response.defer()后无法响应Interaction [Nextcord]

Ded*_*den 4 discord nextcord

我有一个斜杠命令,但处理需要几秒钟。由于Discord响应交互的限制似乎是3秒,我在文档中找到了interaction.response.defer ()方法,这应该告诉Discord我已经收到了命令(不要抛出错误“交互没有响应” ”)

@client.slash_command(description="Test command", guild_ids=[123456789123456789])
async def test(interaction: nextcord.Interaction):
    await interaction.response.defer()
    await asyncio.sleep(10) # Doing stuff
    await interaction.response.send_message("My actual content")
Run Code Online (Sandbox Code Playgroud)

但我收到这个错误:

nextcord.errors.InteractionResponded: This interaction has already been responded to before
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么 ?

Ded*_*den 9

interaction.followup.send()应该使用而不是send_message()