mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-13 17:29:50 +00:00
Add VocalGuildChannel.slowmode_delay
This commit is contained in:
parent
cc3b987229
commit
9b6753f3b4
@ -885,6 +885,7 @@ class VocalGuildChannel(discord.abc.Connectable, discord.abc.GuildChannel, Hasha
|
|||||||
'user_limit',
|
'user_limit',
|
||||||
'_state',
|
'_state',
|
||||||
'position',
|
'position',
|
||||||
|
'slowmode_delay',
|
||||||
'_overwrites',
|
'_overwrites',
|
||||||
'category_id',
|
'category_id',
|
||||||
'rtc_region',
|
'rtc_region',
|
||||||
@ -912,6 +913,7 @@ class VocalGuildChannel(discord.abc.Connectable, discord.abc.GuildChannel, Hasha
|
|||||||
self.category_id: Optional[int] = utils._get_as_snowflake(data, 'parent_id')
|
self.category_id: Optional[int] = utils._get_as_snowflake(data, 'parent_id')
|
||||||
self.last_message_id: Optional[int] = utils._get_as_snowflake(data, 'last_message_id')
|
self.last_message_id: Optional[int] = utils._get_as_snowflake(data, 'last_message_id')
|
||||||
self.position: int = data['position']
|
self.position: int = data['position']
|
||||||
|
self.slowmode_delay = data.get('rate_limit_per_user', 0)
|
||||||
self.bitrate: int = data['bitrate']
|
self.bitrate: int = data['bitrate']
|
||||||
self.user_limit: int = data['user_limit']
|
self.user_limit: int = data['user_limit']
|
||||||
self._fill_overwrites(data)
|
self._fill_overwrites(data)
|
||||||
@ -1042,6 +1044,13 @@ class VoiceChannel(discord.abc.Messageable, VocalGuildChannel):
|
|||||||
*not* point to an existing or valid message.
|
*not* point to an existing or valid message.
|
||||||
|
|
||||||
.. versionadded:: 2.0
|
.. versionadded:: 2.0
|
||||||
|
slowmode_delay: :class:`int`
|
||||||
|
The number of seconds a member must wait between sending messages
|
||||||
|
in this channel. A value of ``0`` denotes that it is disabled.
|
||||||
|
Bots and users with :attr:`~Permissions.manage_channels` or
|
||||||
|
:attr:`~Permissions.manage_messages` bypass slowmode.
|
||||||
|
|
||||||
|
.. versionadded:: 2.2
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__slots__ = ()
|
__slots__ = ()
|
||||||
@ -1387,6 +1396,9 @@ class VoiceChannel(discord.abc.Messageable, VocalGuildChannel):
|
|||||||
category: Optional[:class:`CategoryChannel`]
|
category: Optional[:class:`CategoryChannel`]
|
||||||
The new category for this channel. Can be ``None`` to remove the
|
The new category for this channel. Can be ``None`` to remove the
|
||||||
category.
|
category.
|
||||||
|
slowmode_delay: :class:`int`
|
||||||
|
Specifies the slowmode rate limit for user in this channel, in seconds.
|
||||||
|
A value of ``0`` disables slowmode. The maximum value possible is ``21600``.
|
||||||
reason: Optional[:class:`str`]
|
reason: Optional[:class:`str`]
|
||||||
The reason for editing this channel. Shows up on the audit log.
|
The reason for editing this channel. Shows up on the audit log.
|
||||||
overwrites: :class:`Mapping`
|
overwrites: :class:`Mapping`
|
||||||
@ -1417,7 +1429,6 @@ class VoiceChannel(discord.abc.Messageable, VocalGuildChannel):
|
|||||||
The newly edited voice channel. If the edit was only positional
|
The newly edited voice channel. If the edit was only positional
|
||||||
then ``None`` is returned instead.
|
then ``None`` is returned instead.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
payload = await self._edit(options, reason=reason)
|
payload = await self._edit(options, reason=reason)
|
||||||
if payload is not None:
|
if payload is not None:
|
||||||
# the payload will always be the proper channel payload
|
# the payload will always be the proper channel payload
|
||||||
@ -1477,6 +1488,13 @@ class StageChannel(VocalGuildChannel):
|
|||||||
The camera video quality for the stage channel's participants.
|
The camera video quality for the stage channel's participants.
|
||||||
|
|
||||||
.. versionadded:: 2.0
|
.. versionadded:: 2.0
|
||||||
|
slowmode_delay: :class:`int`
|
||||||
|
The number of seconds a member must wait between sending messages
|
||||||
|
in this channel. A value of ``0`` denotes that it is disabled.
|
||||||
|
Bots and users with :attr:`~Permissions.manage_channels` or
|
||||||
|
:attr:`~Permissions.manage_messages` bypass slowmode.
|
||||||
|
|
||||||
|
.. versionadded:: 2.2
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__slots__ = ('topic',)
|
__slots__ = ('topic',)
|
||||||
@ -1681,6 +1699,9 @@ class StageChannel(VocalGuildChannel):
|
|||||||
category: Optional[:class:`CategoryChannel`]
|
category: Optional[:class:`CategoryChannel`]
|
||||||
The new category for this channel. Can be ``None`` to remove the
|
The new category for this channel. Can be ``None`` to remove the
|
||||||
category.
|
category.
|
||||||
|
slowmode_delay: :class:`int`
|
||||||
|
Specifies the slowmode rate limit for user in this channel, in seconds.
|
||||||
|
A value of ``0`` disables slowmode. The maximum value possible is ``21600``.
|
||||||
reason: Optional[:class:`str`]
|
reason: Optional[:class:`str`]
|
||||||
The reason for editing this channel. Shows up on the audit log.
|
The reason for editing this channel. Shows up on the audit log.
|
||||||
overwrites: :class:`Mapping`
|
overwrites: :class:`Mapping`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user