Can't unsync permissions of a text channel with the category. #6888
Replies: 1 comment 1 reply
-
I'm not sure what exactly is going on in here or how the issue is manifesting. However, you shouldn't have to specify default_role = message.guild.default_role
category_overwrites = {
message.guild.get_member(player_id): discord.PermissionOverwrite(view_channel=True)
for player_id in player_list
}
category_overwrites[default_role] = discord.PermissionOverwrite(view_channel=False)
category = await message.guild.create_category_channel("name", overwrites=category_overwrites) Aside from that, you can also do the same for the text channel creation, but I'll leave that as an exercise for you. Note that "syncing" permissions is mostly a visual client-side indicator of whether the channel overwrites are the same as the category overwrites. From what I'm seeing in this code the permissions are different, so either this is a client bug or there's something else I'm missing from this short snippet of code. |
Beta Was this translation helpful? Give feedback.
-
Hi, im trying to set up a a category and bunch of channels with my bot (for a game to be played in them). There needs to be a category only players should be able to see, a general chat in that category for those players and a private channel for each player.
I take player mentions as an input, set up a category with view_channel= False for everyone and view_channel= True for these mentioned players. This works without any problem.
Then I create private channels for each player with view_channel= False for everyone and view_channel= True for the selected player but I can't unsync the channels' permissions with category permissions so the private channels just work like the general chat channel in that category should.
Here is the code im trying:
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions