Skip to content

Commit 0fe9b0a

Browse files
authored
Merge pull request #603 from SlimShadyIAm/master
Add Member.timed_out property
2 parents dad9021 + 78f5608 commit 0fe9b0a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

discord/member.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,15 @@ def voice(self) -> Optional[VoiceState]:
620620
"""Optional[:class:`VoiceState`]: Returns the member's current voice state."""
621621
return self.guild._voice_state_for(self._user.id)
622622

623+
@property
624+
def timed_out(self) -> bool:
625+
"""bool: Returns whether the member is timed out.
626+
627+
.. versionadded:: 2.0
628+
"""
629+
return self.communication_disabled_until is not None and self.communication_disabled_until > datetime.datetime.now(datetime.timezone.utc)
630+
631+
623632
async def ban(
624633
self,
625634
*,

0 commit comments

Comments
 (0)