Repository: Rapptz/discord.py
File: discord/guild.py (Python)

Code before:
            return None

        return utils.parse_time(self._incidents_data.get('invites_disabled_until'))

    @property
    def dms_paused_until(self) -> Optional[datetime.datetime]:
        """Optional[:class:`datetime.datetime`]: If DMs are paused, returns when DMs
        will get enabled in UTC, otherwise returns None.

        .. versionadded:: 2.4
        """
        if not self._incidents_data:
            return None

        return utils.parse_time(self._incidents_data.get('dms_disabled_until'))

    @property
    def dm_spam_detected_at(self) -> Optional[datetime.datetime]:
        """: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.

        .. versionadded:: 2.4
        """
        if not self._incidents_data:
            return None

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

    def invites_paused(self) -> bool:
        """:class:`bool`: Whether invites are paused in the guild.

        .. versionadded:: 2.4
        """
        if not self.invites_paused_until:
            return False

        return self.invites_paused_until > utils.utcnow()

    def dms_paused(self) -> bool:
        """:class:`bool`: Whether DMs are paused in the guild.


Review comment (suggestion):
```suggestion
        return utils.parse_time(self._incidents_data.get('dm_spam_detected_at'))
```

Code after:
            trigger_type=trigger.type.value,
            trigger_metadata=trigger.to_metadata_dict() or None,
            actions=[a.to_dict() for a in actions],
            enabled=enabled,
            exempt_roles=[str(r.id) for r in exempt_roles] if exempt_roles else None,
            exempt_channels=[str(c.id) for c in exempt_channels] if exempt_channels else None,
            reason=reason,
        )

        return AutoModRule(data=data, guild=self, state=self._state)

    @property
    def invites_paused_until(self) -> Optional[datetime.datetime]:
        """Optional[:class:`datetime.datetime`]: If invites are paused, returns when
        invites will get enabled in UTC, otherwise returns None.

        .. versionadded:: 2.4
        """
        if not self._incidents_data:
            return None

        return utils.parse_time(self._incidents_data.get('invites_disabled_until'))

    @property
    def dms_paused_until(self) -> Optional[datetime.datetime]:
        """Optional[:class:`datetime.datetime`]: If DMs are paused, returns when DMs
        will get enabled in UTC, otherwise returns None.

        .. versionadded:: 2.4
        """
        if not self._incidents_data:
            return None

        return utils.parse_time(self._incidents_data.get('dms_disabled_until'))

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

        .. versionadded:: 2.5
        """
        if not self._incidents_data:
            return None

        return utils.parse_time(self._incidents_data.get('dm_spam_detected_at'))

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

        .. versionadded:: 2.5