Browse Source

Add overloads to utils.sleep_until

pull/8402/head
Josh 3 years ago
committed by GitHub
parent
commit
0981f122af
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      discord/utils.py

10
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|

Loading…
Cancel
Save