Skip to content

Commit

Permalink
Add missing versionadded strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Soheab committed Apr 27, 2024
1 parent 2a66357 commit cfe4137
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions discord/guild.py
Expand Up @@ -4418,15 +4418,21 @@ def dms_paused_until(self) -> Optional[datetime.datetime]:

@property
def dm_spam_detected_at(self) -> Optional[datetime.datetime]:
""":class:`datetime.datetime`: Returns the time when DM spam was detected in the guild."""
""":class:`datetime.datetime`: Returns the time when DM spam was detected in the guild.
.. versionadded:: 2.4
"""
if not self._incidents_data:
return None

return self._incidents_data.get('dm_spam_detected_at', None)

@property
def raid_detected_at(self) -> Optional[datetime.datetime]:
"""Optional[:class:`datetime.datetime`]: Returns the time when a raid was detected in the guild"""
"""Optional[:class:`datetime.datetime`]: Returns the time when a raid was detected in the guild.
.. versionadded:: 2.4
"""
if not self._incidents_data:
return None

Expand All @@ -4453,14 +4459,20 @@ def dms_paused(self) -> bool:
return self.dms_paused_until > utils.utcnow()

def dm_spam_detected(self) -> bool:
""":class:`bool`: Whether DM spam was detected in the guild."""
""":class:`bool`: Whether DM spam was detected in the guild.
.. versionadded:: 2.4
"""
if not self.dm_spam_detected_at:
return False

return self.dm_spam_detected_at > utils.utcnow()

def raid_detected(self) -> bool:
""":class:`bool`: Whether a raid was detected in the guild."""
""":class:`bool`: Whether a raid was detected in the guild.
.. versionadded:: 2.4
"""
if not self.raid_detected_at:
return False

Expand Down

0 comments on commit cfe4137

Please sign in to comment.