mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-21 08:17:47 +00:00
Fix bug in permission resolution when dealing with timed out members
This would lead to timed out members having the read_messages permission set to True instead of False
This commit is contained in:
parent
3dddddc8f9
commit
77baa06a99
@ -732,12 +732,6 @@ class GuildChannel:
|
||||
if base.administrator:
|
||||
return Permissions.all()
|
||||
|
||||
if obj.is_timed_out():
|
||||
# Timeout leads to every permission except VIEW_CHANNEL and READ_MESSAGE_HISTORY
|
||||
# being explicitly denied
|
||||
base.value &= Permissions._timeout_mask()
|
||||
return base
|
||||
|
||||
# Apply @everyone allow/deny first since it's special
|
||||
try:
|
||||
maybe_everyone = self._overwrites[0]
|
||||
@ -779,6 +773,12 @@ class GuildChannel:
|
||||
denied = Permissions.all_channel()
|
||||
base.value &= ~denied.value
|
||||
|
||||
if obj.is_timed_out():
|
||||
# Timeout leads to every permission except VIEW_CHANNEL and READ_MESSAGE_HISTORY
|
||||
# being explicitly denied
|
||||
# N.B.: This *must* come last, because it's a conclusive mask
|
||||
base.value &= Permissions._timeout_mask()
|
||||
|
||||
return base
|
||||
|
||||
async def delete(self, *, reason: Optional[str] = None) -> None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user