Discord.js 禁用“交互失败”

Sir*_*art 2 javascript node.js discord discord.js

如果交互(例如按钮点击)没有得到回复,discord 会在客户端显示 \xe2\x80\x9cinteraction failed\xe2\x80\x9d

\n

他们希望你做什么:inter.reply(\xe2\x80\x98stuff\xe2\x80\x99)

\n

我想做的事:inter.channel.send(\xe2\x80\x98stuff\xe2\x80\x99)

\n

这不是一个错误,我只是想阻止 \xe2\x80\x9cinteraction failed\xe2\x80\x9d 显示,有办法做到这一点吗?

\n

MrM*_*cal 8

您可以使用ButtonInteraction.deferUpdate()。这不会显示“此交互失败”,它会回复说您稍后将对其进行编辑[1],尽管它不会显示任何类似的内容Bot is thinking...

inter.deferUpdate();
inter.channel.send("some content")
Run Code Online (Sandbox Code Playgroud)

[1]:之后您不必更新