From 0981f122afc69772a3541b205b382256cc8f3d1d Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 28 Aug 2022 16:08:38 +1000 Subject: [PATCH] Add overloads to utils.sleep_until --- discord/utils.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/discord/utils.py b/discord/utils.py index e49a78bfd..63e64d485 100644 --- a/discord/utils.py +++ b/discord/utils.py @@ -690,6 +690,16 @@ def compute_timedelta(dt: datetime.datetime) -> float: return max((dt - now).total_seconds(), 0) +@overload +async def sleep_until(when: datetime.datetime, result: T) -> T: + ... + + +@overload +async def sleep_until(when: datetime.datetime) -> None: + ... + + async def sleep_until(when: datetime.datetime, result: Optional[T] = None) -> Optional[T]: """|coro|