Browse Source

Add VocalGuildChannel.slowmode_delay

pull/9141/head
rdrescher909 2 years ago
committed by GitHub
parent
commit
9b6753f3b4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 23
      discord/channel.py

23
discord/channel.py

@ -885,6 +885,7 @@ class VocalGuildChannel(discord.abc.Connectable, discord.abc.GuildChannel, Hasha
'user_limit',
'_state',
'position',
'slowmode_delay',
'_overwrites',
'category_id',
'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.last_message_id: Optional[int] = utils._get_as_snowflake(data, 'last_message_id')
self.position: int = data['position']
self.slowmode_delay = data.get('rate_limit_per_user', 0)
self.bitrate: int = data['bitrate']
self.user_limit: int = data['user_limit']
self._fill_overwrites(data)
@ -1042,6 +1044,13 @@ class VoiceChannel(discord.abc.Messageable, VocalGuildChannel):
*not* point to an existing or valid message.
.. 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__ = ()
@ -1387,6 +1396,9 @@ class VoiceChannel(discord.abc.Messageable, VocalGuildChannel):
category: Optional[:class:`CategoryChannel`]
The new category for this channel. Can be ``None`` to remove the
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`]
The reason for editing this channel. Shows up on the audit log.
overwrites: :class:`Mapping`
@ -1417,7 +1429,6 @@ class VoiceChannel(discord.abc.Messageable, VocalGuildChannel):
The newly edited voice channel. If the edit was only positional
then ``None`` is returned instead.
"""
payload = await self._edit(options, reason=reason)
if payload is not None:
# 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.
.. 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',)
@ -1681,6 +1699,9 @@ class StageChannel(VocalGuildChannel):
category: Optional[:class:`CategoryChannel`]
The new category for this channel. Can be ``None`` to remove the
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`]
The reason for editing this channel. Shows up on the audit log.
overwrites: :class:`Mapping`

Loading…
Cancel
Save