This allows you to strictly require a number of arguments. The default
behaviour in this case is still `True`, since it would be a breaking
change otherwise and is a sane default. However if someone would want
to set this to `False`, they would receive an exception of type
`TooManyArguments` if too many arguments are passed to a command.
Hopefully this removes the uses of `ctx.message.content == 'stuff'`
inside commands.
Global checks are checks that are executed before regular per-command
checks except done to every command that the bot has registered. This
allows you to have checks that apply to every command without having to
override `on_message` or appending the check to every single command.
This includes `Client.pin_message`, `Client.unpin_message` and
`Client.pins_from`. This also adds the `Message.pinned` attribute
to the `Message` object.
Logging in with an invalid token would throw a TypeError due to improper
passing of arguments to HTTPClient._token. Fix by properly passing the
keyword only bot argument.
This should have a more uniform approach to rate limit handling. Instead
of queueing every request, wait until we receive a 429 and then block
the requesting bucket until we're done being rate limited. This should
reduce the number of 429s done by the API significantly (about 66% avg).
This also consistently checks for 502 retries across all requests.
This change should make it a bit more intuitive to get the original
exception without having the gotcha of checking ``isinstance`` inside
the error handler.
On that note, fix the background_task example to use `Client.run`
instead of manual loop management. That way the task will be cleaned
up and cancelled inside `Client.run`.