mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 20:28:38 +00:00
Raise TypeError when token is not a string
Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com>
This commit is contained in:
parent
c8db766be4
commit
584c22f642
@ -630,7 +630,11 @@ class Client:
|
|||||||
if self.loop is _loop:
|
if self.loop is _loop:
|
||||||
await self._async_setup_hook()
|
await self._async_setup_hook()
|
||||||
|
|
||||||
data = await self.http.static_login(token.strip())
|
if not isinstance(token, str):
|
||||||
|
raise TypeError(f'expected token to be a str, received {token.__class__!r} instead')
|
||||||
|
token = token.strip()
|
||||||
|
|
||||||
|
data = await self.http.static_login(token)
|
||||||
self._connection.user = ClientUser(state=self._connection, data=data)
|
self._connection.user = ClientUser(state=self._connection, data=data)
|
||||||
self._application = await self.application_info()
|
self._application = await self.application_info()
|
||||||
if self._connection.application_id is None:
|
if self._connection.application_id is None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user