2024-05-16 00:31:32 发布
网友
是否有任何方法可以删除由bot本身以外的任何人发送的消息,文档似乎表明这是可能的
Your own messages could be deleted without any proper permissions. However to delete other people’s messages, you need the proper permissions to do so.
但是我找不到一种方法来在on_消息事件触发器中定位消息,是我遗漏了什么还是不可能?
是的,这应该是可能的。
您需要bot/用户帐户具有“管理邮件”权限。
@client.event async def on_message(message): await client.delete_message(message)
所以,事件会发生
>User sends message >Bot detects that the user has sent a message >Bot deletes the message that the user sent
希望您能从中看到用户消息是如何被删除的,只要确保bot/user帐户具有“管理消息”权限即可。
是的,这应该是可能的。
您需要bot/用户帐户具有“管理邮件”权限。
所以,事件会发生
希望您能从中看到用户消息是如何被删除的,只要确保bot/user帐户具有“管理消息”权限即可。
相关问题 更多 >
编程相关推荐