简体   繁体   中英

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.

basically how to use this button in discord.py:

在此处输入图像描述

From the docs:

If the overwrite parameter is None , then the permission overwrites are deleted.

So simply:

await channel.set_permissions(member, overwrite=None)

GuildChannel.set_permissions

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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