def is_expired(message):
"""Determines if a raid is expired, given its announcement message.
Message accepts the result returned by get_announcement_message (a valid obj or None).
:param message discord.Message: The announcement message associated with the raid.
:returns: True if the message/raid timestamp is expired
"""
if message is None:
return True # can't find message, clean up the raid channel
return (datetime.utcnow() - message.timestamp) > timedelta(seconds=settings.raid_duration_seconds)
评论列表
文章目录