mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 12:18:59 +00:00
[commands] Document BucketType separately
This commit is contained in:
parent
97d1c970bf
commit
a2b241446e
@ -1776,15 +1776,7 @@ def cooldown(rate, per, type=BucketType.default):
|
|||||||
of times in a specific time frame. These cooldowns can be based
|
of times in a specific time frame. These cooldowns can be based
|
||||||
either on a per-guild, per-channel, per-user, per-role or global basis.
|
either on a per-guild, per-channel, per-user, per-role or global basis.
|
||||||
Denoted by the third argument of ``type`` which must be of enum
|
Denoted by the third argument of ``type`` which must be of enum
|
||||||
type ``BucketType`` which could be either:
|
type :class:`.BucketType`.
|
||||||
|
|
||||||
- ``BucketType.default`` for a global basis.
|
|
||||||
- ``BucketType.user`` for a per-user basis.
|
|
||||||
- ``BucketType.guild`` for a per-guild basis.
|
|
||||||
- ``BucketType.channel`` for a per-channel basis.
|
|
||||||
- ``BucketType.member`` for a per-member basis.
|
|
||||||
- ``BucketType.category`` for a per-category basis.
|
|
||||||
- ``BucketType.role`` for a per-role basis (added in v1.3.0).
|
|
||||||
|
|
||||||
If a cooldown is triggered, then :exc:`.CommandOnCooldown` is triggered in
|
If a cooldown is triggered, then :exc:`.CommandOnCooldown` is triggered in
|
||||||
:func:`.on_command_error` and the local error handler.
|
:func:`.on_command_error` and the local error handler.
|
||||||
@ -1797,7 +1789,7 @@ def cooldown(rate, per, type=BucketType.default):
|
|||||||
The number of times a command can be used before triggering a cooldown.
|
The number of times a command can be used before triggering a cooldown.
|
||||||
per: :class:`float`
|
per: :class:`float`
|
||||||
The amount of seconds to wait for a cooldown when it's been triggered.
|
The amount of seconds to wait for a cooldown when it's been triggered.
|
||||||
type: ``BucketType``
|
type: :class:`.BucketType`
|
||||||
The type of cooldown to have.
|
The type of cooldown to have.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -111,6 +111,38 @@ Help Commands
|
|||||||
.. autoclass:: discord.ext.commands.Paginator
|
.. autoclass:: discord.ext.commands.Paginator
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
Enums
|
||||||
|
------
|
||||||
|
|
||||||
|
.. class:: discord.ext.commands.BucketType
|
||||||
|
|
||||||
|
Specifies a type of bucket for, e.g. a cooldown.
|
||||||
|
|
||||||
|
.. attribute:: default
|
||||||
|
|
||||||
|
The default bucket operates on a global basis.
|
||||||
|
.. attribute:: user
|
||||||
|
|
||||||
|
The user bucket operates on a per-user basis.
|
||||||
|
.. attribute:: guild
|
||||||
|
|
||||||
|
The guild bucket operates on a per-guild basis.
|
||||||
|
.. attribute:: channel
|
||||||
|
|
||||||
|
The channel bucket operates on a per-channel basis.
|
||||||
|
.. attribute:: member
|
||||||
|
|
||||||
|
The member bucket operates on a per-member basis.
|
||||||
|
.. attribute:: category
|
||||||
|
|
||||||
|
The category bucket operates on a per-category basis.
|
||||||
|
.. attribute:: role
|
||||||
|
|
||||||
|
The role bucket operates on a per-role basis.
|
||||||
|
|
||||||
|
.. versionadded:: 1.3.0
|
||||||
|
|
||||||
|
|
||||||
.. _ext_commands_api_checks:
|
.. _ext_commands_api_checks:
|
||||||
|
|
||||||
Checks
|
Checks
|
||||||
|
Loading…
x
Reference in New Issue
Block a user