問題描述
我正在使用 @client.event
并使用 async def on_raw_reaction_add(payload):
來讀取 Discord 反應事件.當我的代碼中的一個標志失敗時,我需要能夠刪除用戶反應.我在文檔中看到有 await remove(user)
但我認為我沒有正確使用它.有什么建議嗎?
I'm using an @client.event
and using async def on_raw_reaction_add(payload):
to read Discord reaction events. I need to be able to delete a user reaction when they fail one of the flags in my code. I saw in the documentation that there is await remove(user)
but I don't think I'm using it right. Any suggestions?
推薦答案
你可以使用 Message.remove_reaction
或 Reaction.remove
.
You can use either Message.remove_reaction
or Reaction.remove
.
Reaction 對象表示對Message,因此如果您擁有的 Reaction 對象不是用于表情符號反應您要刪除的,使用 Reaction.remove
將嘗試刪除錯誤的表情符號反應.
A Reaction object represents a specific emoji reaction to a Message, so if the Reaction object you have is not for the emoji reaction that you want to remove, using Reaction.remove
will attempt to remove the wrong emoji reaction.
這篇關于你如何讓 Discord 機器人刪除用戶對 discord.py 中消息的反應?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!