Validate kwargs in Client.start

This commit is contained in:
NCPlayz 2019-05-19 14:42:33 +01:00 committed by Rapptz
parent 007b7ebf3a
commit 38eb2b4828

View File

@ -503,10 +503,19 @@ class Client:
"""|coro|
A shorthand coroutine for :meth:`login` + :meth:`connect`.
Raises
-------
TypeError
An unexpected keyword argument was received.
"""
bot = kwargs.pop('bot', 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.connect(reconnect=reconnect)