From d19faa5f32e262caf2a7fb562c2ff7b83956e3a9 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sat, 11 Jun 2022 20:29:30 -0400 Subject: [PATCH] Raise an exception when wait_until_ready is called without a loop --- discord/client.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/discord/client.py b/discord/client.py index 87e3cb3fa..16b1cfe00 100644 --- a/discord/client.py +++ b/discord/client.py @@ -1012,6 +1012,11 @@ class Client: """ if self._ready is not MISSING: await self._ready.wait() + else: + raise RuntimeError( + 'Client has not been properly initialised. ' + 'Please use the login method or asynchronous context manager before calling this method' + ) def wait_for( self,