本文介紹了discord.js 禁用“交互失敗"的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
如果一個交互(例如按鈕點擊)沒有被回復,discord會在客戶端顯示交互失敗"
If an interaction (for example button click) is not replied, discord will display "interaction failed" in the client
他們希望你做什么:inter.reply(‘stuff’)
我想做的事:inter.channel.send(‘stuff’)
這不是錯誤,我只是想防止交互失敗"出現(xiàn),有什么辦法嗎?
This is not an error I just want to prevent "interaction failed" from showing up, is there anyway to do that?
推薦答案
你可以使用ButtonInteraction.deferUpdate()
.這不會顯示此交互失敗",而是應該幾乎忽略交互然后發(fā)送消息
You can use ButtonInteraction.deferUpdate()
. This will not show "This interaction failed", instead it should pretty much ignore the interaction and then send the message
inter.deferUpdate();
inter.channel.send("some content")
這篇關于discord.js 禁用“交互失敗"的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權益,請聯(lián)系我們刪除處理,感謝您的支持!