mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-20 16:00:29 +00:00
Add permissions_synced to abc.GuildChannel
This allows users to check whether or not the permissions for a Guild Channel are synced with the permissions for its category. Discord automatically syncs the permissions when the overwrites are equal so just checking if the two overwrites are equal will determine if they are synced.
This commit is contained in:
parent
87c2508199
commit
125a5676b8
@ -386,6 +386,16 @@ class GuildChannel:
|
||||
"""
|
||||
return self.guild.get_channel(self.category_id)
|
||||
|
||||
@property
|
||||
def permissions_synced(self):
|
||||
""":class:`bool`: Whether or not the permissions for this channel are synced with the
|
||||
category it belongs to.
|
||||
|
||||
If there is no category then this is ``False``.
|
||||
"""
|
||||
category = self.guild.get_channel(self.category_id)
|
||||
return category and category._overwrites == self._overwrites
|
||||
|
||||
def permissions_for(self, member):
|
||||
"""Handles permission resolution for the current :class:`~discord.Member`.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user