mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-10-22 00:13:01 +00:00
Take into consideration member timeouts in permission calculations
This commit is contained in:
@@ -538,6 +538,7 @@ class GuildChannel:
|
||||
- Guild roles
|
||||
- Channel overrides
|
||||
- Member overrides
|
||||
- Member timeout
|
||||
|
||||
If a :class:`~discord.Role` is passed, then it checks the permissions
|
||||
someone with that role would have, which is essentially:
|
||||
@@ -624,6 +625,12 @@ 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]
|
||||
|
||||
Reference in New Issue
Block a user