[英]How can i delete role permissinos with discord.py
You can use TextChannel.set_permissions
to modify the permissions for a certain channel, in your case just iterate over the channels that you need.您可以使用
TextChannel.set_permissions
修改某个频道的权限,在您的情况下,只需遍历您需要的频道。
To be able to delete the permissions you will need to set the overwrite
parameter to None
:为了能够删除权限,您需要将
overwrite
参数设置为None
:
@client.command()
async def delete_perms(ctx):
channel_list = [ ] # Here goes the list of channel IDs to modify
member_list = [ ] # Here goes the list of member IDs that you want to remove permissions
for channel in channel_list:
channel_i = ctx.guild.get_channel(channel)
for member in member_list:
member_i = ctx.guild.get_member(member)
await channel_i.set_permissions(member_i, overwrite=None)
References:参考:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.