From cd18f159ef3b485e542db217e4d286194cfacbe0 Mon Sep 17 00:00:00 2001 From: rohan Date: Mon, 10 May 2021 01:36:21 +0530 Subject: Remove unused function. --- bot/utils/time.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/bot/utils/time.py b/bot/utils/time.py index 3c14b8fba..5e79f3064 100644 --- a/bot/utils/time.py +++ b/bot/utils/time.py @@ -144,22 +144,6 @@ def parse_rfc1123(stamp: str) -> datetime.datetime: return datetime.datetime.strptime(stamp, RFC1123_FORMAT).replace(tzinfo=datetime.timezone.utc) -# Hey, this could actually be used in the off_topic_names cog :) -async def wait_until(time: datetime.datetime, start: Optional[datetime.datetime] = None) -> None: - """ - Wait until a given time. - - :param time: A datetime.datetime object to wait until. - :param start: The start from which to calculate the waiting duration. Defaults to UTC time. - """ - delay = time - (start or datetime.datetime.utcnow()) - delay_seconds = delay.total_seconds() - - # Incorporate a small delay so we don't rapid-fire the event due to time precision errors - if delay_seconds > 1.0: - await asyncio.sleep(delay_seconds) - - def format_infraction(timestamp: str) -> str: """Format an infraction timestamp to a more readable ISO 8601 format.""" return dateutil.parser.isoparse(timestamp).strftime(INFRACTION_FORMAT) -- cgit v1.2.3