简体   繁体   English

如何重置用户的权限 [Discord.py]

[英]How to reset permissions for a user [Discord.py]

I have looked through the documentation and have not been able to find a way to reset permissions or remove a users permissions for a voice channel.我查看了文档,但无法找到重置权限或删除语音通道用户权限的方法。 using this code:使用此代码:

member_permissions = channel.overwrites_for(member)
member_permissions.manage_channels = False
member_permissions.move_members = False
member_permissions.mute_members = False
await channel.set_permissions(member, overwrite=member_permissions)

this code sets all permissions to False, but I want it to remove the users permissions because when you set it to false it still shows in the voice channel permissions.此代码将所有权限设置为 False,但我希望它删除用户权限,因为当您将其设置为 false 时,它仍会显示在语音通道权限中。

basically how to use this button in discord.py:基本上如何在 discord.py 中使用这个按钮:

在此处输入图像描述

From the docs:从文档:

If the overwrite parameter is None , then the permission overwrites are deleted.如果overwrite参数为None ,则权限覆盖被删除。

So simply:很简单:

await channel.set_permissions(member, overwrite=None)

GuildChannel.set_permissions

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM