Browse Source

Fix migration guide docs for abc.PrivateChannel and cooldown()

* Move PrivateChannel ABC change to proper subsection in migration guide
* Add change to the accepted callables in cooldown() to migration guide
pull/10109/head
Jakub Kuczys 3 years ago
committed by dolfies
parent
commit
ec558a24b0
  1. 4
      discord/ext/commands/core.py
  2. 4
      docs/migrating.rst

4
discord/ext/commands/core.py

@ -2378,6 +2378,10 @@ def cooldown(
.. versionchanged:: 1.7
Callables are now supported for custom bucket types.
.. versionchanged:: 2.0
When passing a callable, it now needs to accept :class:`.Context`
rather than :class:`~discord.Message` as its only argument.
"""
def decorator(func: Union[Command, CoroFunc]) -> Union[Command, CoroFunc]:

4
docs/migrating.rst

@ -82,7 +82,6 @@ The following have been changed to :func:`runtime-checkable <typing.runtime_chec
- :class:`abc.Snowflake`
- :class:`abc.User`
- :class:`abc.PrivateChannel`
The following have been changed to subclass :class:`~typing.Protocol`:
@ -92,6 +91,7 @@ The following have been changed to subclass :class:`~typing.Protocol`:
The following have been changed to use the default metaclass instead of :class:`abc.ABCMeta`:
- :class:`abc.Messageable`
- :class:`abc.PrivateChannel`
``datetime`` Objects Are Now UTC-Aware
----------------------------------------
@ -1348,6 +1348,8 @@ Miscellaneous Changes
- To override a cog, the new ``override`` parameter can be used.
- When passing a callable to ``type`` argument of :meth:`~ext.commands.cooldown`,
it now needs to accept :class:`~ext.commands.Context` rather than :class:`Message` as its only argument.
- Metaclass of :class:`~ext.commands.Context` changed from :class:`abc.ABCMeta` to :class:`type`.
- Changed type of :attr:`ext.commands.Command.clean_params` from :class:`collections.OrderedDict` to :class:`dict`.
as the latter is guaranteed to preserve insertion order since Python 3.7.

Loading…
Cancel
Save