mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-06 09:56:09 +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:
@ -630,7 +630,11 @@ class Client:
|
||||
if self.loop is _loop:
|
||||
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._application = await self.application_info()
|
||||
if self._connection.application_id is None:
|
||||
|
Reference in New Issue
Block a user