Validate kwargs in Client.start
This commit is contained in:
parent
007b7ebf3a
commit
38eb2b4828
@ -503,10 +503,19 @@ class Client:
|
|||||||
"""|coro|
|
"""|coro|
|
||||||
|
|
||||||
A shorthand coroutine for :meth:`login` + :meth:`connect`.
|
A shorthand coroutine for :meth:`login` + :meth:`connect`.
|
||||||
|
|
||||||
|
Raises
|
||||||
|
-------
|
||||||
|
TypeError
|
||||||
|
An unexpected keyword argument was received.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
bot = kwargs.pop('bot', True)
|
bot = kwargs.pop('bot', True)
|
||||||
reconnect = kwargs.pop('reconnect', True)
|
reconnect = kwargs.pop('reconnect', True)
|
||||||
|
|
||||||
|
if kwargs:
|
||||||
|
raise TypeError("unexpected keyword argument(s) %s" % list(kwargs.keys()))
|
||||||
|
|
||||||
await self.login(*args, bot=bot)
|
await self.login(*args, bot=bot)
|
||||||
await self.connect(reconnect=reconnect)
|
await self.connect(reconnect=reconnect)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user